skillfed

retryhttp

Retry potentially transient HTTP errors in Python.

retryhttp v1.5.0 4.4M downloads/30d#2,321 on PyPI14
Permissive 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) Active released

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 retryhttp

uv

uv add retryhttp

poetry

poetry add retryhttp

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Internet :: WWW/HTTPTopic :: Utilities

Tags

http retry decoratorautomatic transient error retryrate limit retry handlerhttp timeout retry logictenacity http wrapper429 500 502 503 504 retryhttp resilience layer
http-resiliencedecorator-patterntransient-error-handling

More WWW/HTTP packages