# gabrielfalcao/HTTPretty

Intercept HTTP requests at the Python socket level. Fakes the whole socket module

Repository: https://github.com/gabrielfalcao/HTTPretty
Canonical: https://ross.abutalabs.com/products/httpretty
Homepage: https://httpretty.readthedocs.org
Language: Python
License: MIT
License Family: permissive
Topics: http, mock, fakeweb, python, httpretty, python2, streaming-response, decorators, testing, testing-tools, tdd, mocking
Last push: 2024-06-09T14:37:11+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 5696, "days_push": 815, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2159, forks 285 (observed 2026-08-28T04:06:20.753031+00:00)

## What it is
HTTPretty is a Python library that mocks HTTP clients by intercepting requests at the socket level, faking the entire socket module. It lets tests register fake URI responses, stream responses, and record/replay HTTP traffic without real network access.

## Use cases
- mock http requests in python tests
- fake responses from external apis
- test api integrations without network access
- record and playback http requests
- unit test code that uses requests or urllib
- disable network access during tests

## When to choose
- you need socket-level interception that works regardless of the HTTP client library
- you want decorator-based activation in tests
- you need to fake streaming responses or record/replay traffic

## When to avoid
- you only use the requests library and prefer a higher-level mock like responses
- you need mocking for modern Python versions beyond 3.9
- you need an actively developed alternative like responses or pytest-httpserver

## Facets
- artifact type: library
- maturity: maintenance
- function: mocking, testing, http-client
- domain: testing, developer-tools, apis, web-development
- platform: python, cross-platform
- tags: http-mocking, socket-level-interception, tdd, fake-socket, record-and-playback

## Member repositories
- gabrielfalcao/HTTPretty (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:20.753031+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:50:19.973323+00:00, confidence not recorded.
  - readme: https://github.com/gabrielfalcao/HTTPretty (fetched 2026-08-28T04:06:20.753031+00:00, sha 974dbb88f60c)
  - registry_pypi: https://pypi.org/pypi/httpretty/json (fetched 2026-08-29T10:30:42.355974+00:00, sha 89a9789b6dcc)
- Data as of 2026-08-30T08:39:29.467469+00:00.
