retryhttp
Retry potentially transient HTTP errors in Python.
What it is and what it does
Retryhttp is a decorator-based retry layer for Python HTTP clients that handles transient failures automatically. It extends tenacity with custom strategies for HTTP-specific errors: status codes 429, 500, 502, 503, 504, plus network errors and timeouts. The package natively supports requests, httpx, httpx2, and aiohttp, with sensible defaults for retry counts and backoff timing that you can fully customize. It solves the common problem of flaky HTTP calls in production by reducing boilerplate retry logic and applying proven strategies for each error type.
You apply it as a simple decorator around any function that makes HTTP calls, and it handles the retry loop internally. The package depends on pydantic for configuration and tenacity for the underlying retry machinery, keeping the surface simple while leveraging a mature retry framework underneath.
Use it for:
- Wrap API calls to third-party services that occasionally rate-limit or return transient 5xx errors
- Protect against temporary network blips and timeouts in microservice communication
- Reduce manual retry logic in data-fetching scripts that hit flaky endpoints
- Add resilience to web scraping tasks without rewriting error handling
- Handle rate-limit responses (429) with appropriate backoff in batch processing jobs
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Retryhttp wraps HTTP client calls to automatically retry transient failures like rate limits, server errors, network issues, and timeouts, using sensible defaults but fully customizable retry and wait strategies.
Yes. Retryhttp is actively maintained, has no known vulnerabilities, low install friction, and solves a common production problem with a clean API. The Apache 2.0 license is permissive. Install it if you make HTTP calls that might fail transiently and want to avoid writing retry boilerplate.
Install
retryhttp on PyPI
pip
pip install retryhttpuv
uv add retryhttppoetry
poetry add retryhttpInstalling retryhttp
Before you install
Low friction: pure Python wheel with only two runtime dependencies (pydantic and tenacity). Last release 53 days ago, active repository with recent commits, marked Production/Stable.
License in practice
Apache License 2.0 is permissive; you can use, modify, and distribute retryhttp freely in commercial and private projects, provided you include a copy of the license and note any changes you make.
Quickstart
pip install retryhttp
from retryhttp import retry
@retry
def fetch():
# Make HTTP call with your preferred library
# Retries on 429, 500, 502, 503, 504, network errors, timeouts
pass
Requires Python 3.10 or later. Requires one of the supported HTTP libraries (requests, httpx, httpx2, or aiohttp) to be installed separately.
Verify before relying
- Default retry count and backoff timing specifics beyond the documented error types
- Whether custom retry predicates can be defined for non-standard error conditions
- Performance overhead of the decorator on high-volume request patterns
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pydantic, tenacity |
| Maintenance | actively maintained — 53 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,360,994/month — #2,321 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: retryhttp-1.5.0-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
tenacityTenacity is a retry library that adds automatic…
permissive · top 100 on PyPI
retry-requestsWraps requests Session objects to automatically…
copyleft · top 15,000 on PyPI
http-exceptionsProvides a set of raisable exception classes…
permissive · top 15,000 on PyPI
staminaStamina wraps Tenacity to provide a…
permissive · top 5,000 on PyPI
pyramid-retrypyramid_retry wraps Pyramid requests with…
permissive · top 15,000 on PyPI
merakiA Python client library for the Cisco Meraki…
permissive · top 5,000 on PyPI
httpxthrottlecacheWraps HTTPX with built-in rate limiting and…
unclear · top 15,000 on PyPI
eth-retryA decorator that automatically retries…
permissive · top 15,000 on PyPI
httpx-retriesAdds automatic request retry logic to HTTPX,…
permissive · top 5,000 on PyPI
awsretryA decorator that wraps AWS API calls to…
permissive · top 15,000 on PyPI