skillfed

responses

A utility library for mocking out the `requests` Python library.

responses Permissive license Apache-2.0 Active 4,344 v0.26.2 released

Install

responses on PyPI

pip

pip install responses

uv

uv add responses

poetry

poetry add responses

Package 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

Intended Audience :: DevelopersIntended Audience :: System AdministratorsOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development

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
mock requests libraryhttp mocking for testsrequests library testingintercept http requestsfake api responsesrequests mock decoratortest http calls

Similar packages