responses
A utility library for mocking out the `requests` Python library.
Install
responses on PyPI
pip
pip install responsesuv
uv add responsespoetry
poetry add responsesPackage facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — requests, urllib3, pyyaml |
| Maintenance | actively maintained — 41 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: responses-0.26.2-py3-none-any.whl
About responses
from the package's own PyPI description — quoted content, verbatim
Responses
.. image:: https://img.shields.io/pypi/v/responses.svg :target: https://pypi.python.org/pypi/responses/
.. image:: https://img.shields.io/pypi/pyversions/responses.svg :target: https://pypi.org/project/responses/
.. image:: https://img.shields.io/pypi/dm/responses :target: https://pypi.python.org/pypi/responses/
.. image:: https://codecov.io/gh/getsentry/responses/branch/master/graph/badge.svg :target: https://codecov.io/gh/getsentry/responses/
A utility library for mocking out the requests Python library.
.. note::
Responses requires Python 3.8 or newer, and requests >= 2.30.0
Table of Contents
.. contents::
Installing
pip install responses
Deprecations and Migration Path
Here you will find a list of deprecated functionality and a migration path for each. Please ensure to update your code according to the guidance.
.. list-table:: Deprecation and Migration :widths: 50 25 50 :header-rows: 1
-
- Deprecated Functionality
- Deprecated in Version
- Migration Path
-
responses.json_params_matcher- 0.14.0 -...
Read as markdown · JSON record · Source repository · Homepage · Docs
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Responses is a mocking library that intercepts requests made by the requests library, allowing you to register mock HTTP responses for testing without hitting real servers.
Installation is straightforward with low friction. The package is actively maintained (last commit 2026-07-24, 41 days since latest release) and depends only on requests, urllib3, and pyyaml—all stable, widely-used libraries. Supports Python 3.8 through 3.13.
Licensed under Apache-2.0 (permissive), which allows free use, modification, and distribution with minimal restrictions, making it safe for both open-source and commercial projects.
Usage
import responses
import requests
@responses.activate
def test_api():
responses.get(
"http://example.com/api",
json={"status": "ok"},
status=200,
)
resp = requests.get("http://example.com/api")
assert resp.json() == {"status": "ok"}
Requires Python 3.8 or newer and requests >= 2.30.0
Verdict: Responses is a well-maintained, actively developed mocking utility for the requests library with low install friction and a permissive Apache-2.0 license. It has no known vulnerabilities, strong community adoption (top 1000 PyPI packages), and clear, straightforward API design. A solid choice for testing HTTP interactions in Python projects.
Needs verification
- Whether the package's test coverage (codecov badge present in description) meets a specific threshold that would indicate code quality
- Performance characteristics when mocking large numbers of requests or complex response patterns
Similar packages
permissive · top 1,000 on PyPI
watchfilespermissive · top 1,000 on PyPI
vcrpypermissive · top 1,000 on PyPI
respxpermissive · top 1,000 on PyPI
pytest-httpxpermissive · top 1,000 on PyPI
flit-corepermissive · top 1,000 on PyPI
sentry-sdkpermissive · top 1,000 on PyPI
openapi-pydanticpermissive · top 1,000 on PyPI
llama-index-llms-openaipermissive · top 1,000 on PyPI
pytest-mockpermissive · top 1,000 on PyPI