pook
HTTP traffic mocking and expectations made easy
Decision gist · record as of 2026-08-14
Yes. pook is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It solves a common testing need (HTTP mocking) with a clean API that works across multiple HTTP clients. Install it if you need to mock HTTP traffic in tests and want flexibility in matching and response definition.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later (CPython or PyPy); only recent versions of supported HTTP clients are tested.
- Low friction: pure Python wheel with only 3 runtime dependencies (furl, jsonschema, xmltodict).
- Actively maintained with last commit 2026-03-11.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) means you can use pook freely in commercial and private projects with minimal restrictions; attribution is appreciated but not legally required.
last release 2026-03-06 (161 days) · last repo commit 2026-03-11 · 374 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 270,323 downloads/mo, #8,237 on PyPI
Alternatives
Verify before relying
pip install pook
import pook
@pook.on
def test_api():
mock = pook.get('http://example.com/api', reply=200, response_json={'status': 'ok'})
assert mock.calls == 0- Whether network delay simulation (mentioned for aiohttp) is fully functional or experimental.
- Specific version constraints for runtime dependencies (furl, jsonschema, xmltodict) beyond pip resolution.
- Real-world compatibility with HTTP client versions newer than those tested.
What it is and what it does
pook is a Python HTTP mocking library that intercepts traffic from popular HTTP clients and lets you define mock responses using a fluent, chainable API. It works as a decorator, context manager, or direct function call, and supports matching on any HTTP primitive (URL, method, headers, body, query params) with full regex capability. The library includes first-class JSON and XML support via jsonschema and xmltodict, JSON Schema body matching, and can simulate raised errors or network delays.
You can use pook in both unit tests and runtime environments, with configurable mock lifetimes (volatile, persistent, or TTL-limited). It ships with a built-in mock engine supporting multiple HTTP clients, but also supports pluggable third-party engines. With only 3 small dependencies (furl, jsonschema, xmltodict) and no compiled requirements, it installs cleanly and works on Python 3.10+ (CPython and PyPy).
Use it for
- Mock external API responses in unit tests without making real network calls to third-party services.
- Test error handling by returning specific HTTP status codes and error payloads from mock endpoints.
- Validate request matching logic by asserting that code sends correct headers, query params, or body.
- Test multiple HTTP clients against the same mock definitions in a single test suite.
- Define reusable mock expectations with regex patterns and JSON Schema validation for request bodies.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
pook is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It solves a common testing need (HTTP mocking) with a clean API that works across multiple HTTP clients. Install it if you need to mock HTTP traffic in tests and want flexibility in matching and response definition.
Install
pook on PyPI
Before you install
Low friction: pure Python wheel with only 3 runtime dependencies (furl, jsonschema, xmltodict). Actively maintained with last commit 2026-03-11.
Requires Python 3.10 or later (CPython or PyPy); only recent versions of supported HTTP clients are tested.
License in practice
MIT license (permissive) means you can use pook freely in commercial and private projects with minimal restrictions; attribution is appreciated but not legally required.
Quickstart
pip install pook
import pook
@pook.on
def test_api():
mock = pook.get('http://example.com/api', reply=200, response_json={'status': 'ok'})
assert mock.calls == 0
Verify before relying
- Whether network delay simulation (mentioned for aiohttp) is fully functional or experimental.
- Specific version constraints for runtime dependencies (furl, jsonschema, xmltodict) beyond pip resolution.
- Real-world compatibility with HTTP client versions newer than those tested.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesfurljsonschemaxmltodict |
| Maintenance | Actively maintained 161 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 270,323 / month, #8,237 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating 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 :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python Modules |
Evidence: pook-2.1.6-py3-none-any.whl
Tags
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 › “mock decorator testing”
- pookpook intercepts and mocks HTTP traffic for testing, supporting…
- freeze-uuidDecorator and context manager to mock Python's uuid module, returning…
- httmockIntercepts and mocks HTTP requests made by the requests library,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
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.
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.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
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.
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.
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.
See also urllib3-mock · httmock · wiremock · responses · mocket · respx · smithy-http · snappi-ixnetwork · aiointercept · aws-lambda-context