$npx skillfedfor your agent

mocket

Socket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support

Worth itPyPI Software DevelopmentReleased Jul 2026261.1K downloads / moBSD-3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — mocket-3.14.3-py3-none-any.whl
v3.14.3 · released 2026-07-13 · Python >=3.8 · 5 runtime deps: decorator, h11, puremagic, typing-extensions, urllib3

Yes. Mocket is mature (active maintenance, 312 GitHub stars, no known vulnerabilities), has low install friction, and solves a real testing problem—isolating socket-based code from the network. Use it if you need to mock HTTP clients, test asyncio/gevent code, or build custom protocol mocks. The permissive BSD-3-Clause license poses no restriction.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction: pure Python wheel with five lightweight runtime dependencies (decorator, h11, puremagic, typing-extensions, urllib3).
  • Actively maintained with a recent release; last commit 2026-07-13.
  • Supports modern Python versions (3.8–3.14) and PyPy.

License · maintenance · safety

BSD-3-Clause (permissive) — BSD-3-Clause (permissive): you can use, modify, and distribute mocket in proprietary projects without restriction, provided you include the license notice.

last release 2026-07-13 (32 days) · last repo commit 2026-07-13 · 312 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 261,074 downloads/mo, #8,388 on PyPI

Verify before relying

pip install mocket

from mocket import mocketize
from mocket.mocks.mockhttp import Entry

@mocketize
def test_api():
    Entry.single_register(
        Entry.GET,
        'https://api.example.com/data',
        body='{"key": "value"}',
        headers={'content-type': 'application/json'}
    )
  • Whether the Redis mock implementation is feature-complete enough for production test scenarios.
  • Performance characteristics when mocking high-volume socket interactions.
  • Compatibility with less common async frameworks beyond gevent and asyncio.
Same gist for agents: .md · .json

What it is and what it does

Mocket monkey-patches Python's socket and ssl modules to intercept network calls during testing, allowing you to define mock responses without touching the real network. It serves two roles: as a low-level framework for building custom protocol mocks (e.g., for new databases or protocols) and as a ready-to-use HTTP/HTTPS mock. The package includes a basic Redis mock and supports gevent, asyncio, and SSL out of the box.

You register mock entries with expected URLs, methods, and response bodies, then use a decorator or context manager to activate mocking for your test. Mocket also offers strict mode to fail tests that attempt real network access, and can verify that all registered mock entries were actually used. It depends on decorator, h11, puremagic, typing-extensions, and urllib3 at runtime.

Use it for

  • Test HTTP/HTTPS clients without hitting real endpoints or rate limits.
  • Mock HTTPS calls with SSL support in unit tests for web service integrations.
  • Build custom protocol mocks for testing database clients or proprietary socket-based services.
  • Enforce network isolation in CI/CD by using strict mode to fail tests that leak real socket calls.
  • Test error paths by mocking socket exceptions and connection failures.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Mocket is mature (active maintenance, 312 GitHub stars, no known vulnerabilities), has low install friction, and solves a real testing problem—isolating socket-based code from the network. Use it if you need to mock HTTP clients, test asyncio/gevent code, or build custom protocol mocks. The permissive BSD-3-Clause license poses no restriction.

Install

mocket on PyPI

Before you install

Low friction: pure Python wheel with five lightweight runtime dependencies (decorator, h11, puremagic, typing-extensions, urllib3). Actively maintained with a recent release; last commit 2026-07-13. Supports modern Python versions (3.8–3.14) and PyPy.

License in practice

BSD-3-Clause (permissive): you can use, modify, and distribute mocket in proprietary projects without restriction, provided you include the license notice.

Quickstart

pip install mocket

from mocket import mocketize
from mocket.mocks.mockhttp import Entry

@mocketize
def test_api():
    Entry.single_register(
        Entry.GET,
        'https://api.example.com/data',
        body='{"key": "value"}',
        headers={'content-type': 'application/json'}
    )

Verify before relying

  • Whether the Redis mock implementation is feature-complete enough for production test scenarios.
  • Performance characteristics when mocking high-volume socket interactions.
  • Compatibility with less common async frameworks beyond gevent and asyncio.

Package facts

LicenseBSD-3-Clause permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
5 packages
decoratorh11puremagictyping-extensionsurllib3
MaintenanceActively maintained 32 days since the last release
Last repo commit
First released
Downloads261,074 / month, #8,388 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 6 - MatureIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software DevelopmentTopic :: Software Development :: Testing

Evidence: mocket-3.14.3-py3-none-any.whl

Tags

Capabilities
socket mocking frameworkmock http requests testingintercept socket callstest without networkasyncio socket mockssl mock testinggevent socket mocking
Topics
testing-frameworksocket-mockingasyncio-support

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “socket mocking framework”

  • mocketMocket is a socket mocking framework that intercepts and replaces…
  • aiointerceptIntercepts aiohttp client requests by routing them through a real…
  • mockitoMockito is a spying and stubbing framework for Python that lets you…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also httmock · urllib3-mock · aiointercept · pook · responses · pytest-responses · wiremock · pytest-httpbin · pytest-localserver · moto-ext