reretry
An easy to use, but functional decorator for retrying on exceptions.
What it is and what it does
reretry is a decorator-based retry library that wraps function calls to automatically re-execute them on failure. It's a fork of the original `retry` package with added features: traceback logging on failed attempts, custom callback hooks after each failure, and support for async functions. The package has no external dependencies and works entirely with Python's standard library.
You decorate a function with @retry and configure exception types, maximum attempts, delay between retries, exponential backoff, jitter, and logging behavior. It also provides a retry_call() function for dynamic retry configuration at runtime. The library is straightforward to use for common patterns like network requests, API calls, or any operation prone to transient failures.
Use it for:
- Retry HTTP requests or API calls with exponential backoff when facing transient network failures.
- Wrap database operations to automatically retry on connection timeouts or temporary unavailability.
- Retry async functions in concurrent applications where occasional failures are expected and recoverable.
- Add custom failure callbacks to log, alert, or clean up state after each failed attempt before retrying.
- Dynamically adjust retry behavior at runtime using retry_call() based on application logic or configuration.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A decorator and function wrapper for retrying failed function calls with configurable delays, backoff, jitter, and exception handling—works with both sync and async functions.
Yes, if you need a simple, dependency-free retry decorator for sync or async functions. The library is well-documented and covers common retry patterns. However, the abandoned maintenance status (no updates since December 2022) means you should evaluate whether you can tolerate lack of future bug fixes or Python version support—acceptable for stable, low-risk retry logic but risky if you depend on active maintenance.
Install
reretry on PyPI
pip
pip install reretryuv
uv add reretrypoetry
poetry add reretryInstalling reretry
Before you install
Low friction: pure Python with no runtime dependencies, distributed as a wheel. Maintenance status is abandoned (last release 2022-12-18, 1335 days ago), so expect no bug fixes or updates.
License in practice
Apache License 2.0 is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
from reretry import retry
@retry(ValueError, tries=3, delay=1, backoff=2)
def unstable_operation():
# function body
pass
unstable_operation()
Requires Python 3.7 or later. Optional: install the `decorator` package to preserve function signatures.
Verify before relying
- Whether the abandoned status and lack of updates since 2022-12-18 pose a risk for your use case.
- Performance characteristics when used with high-frequency retry scenarios or very large numbers of retries.
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,335 days since the last release |
| First released | |
| Downloads | 164,764/month — #10,539 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: reretry-0.11.8-py2.py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
aioretryProvides a decorator-based retry mechanism for…
permissive · top 15,000 on PyPI
django-dbconn-retryAutomatically reconnects Django database…
permissive · top 15,000 on PyPI
eth-retryA decorator that automatically retries…
permissive · top 15,000 on PyPI
justbackoffImplements exponential backoff with optional…
permissive · top 15,000 on PyPI
redoRedo provides decorators, functions, and a…
copyleft · top 5,000 on PyPI
retryProvides a decorator and function wrapper for…
permissive · top 1,000 on PyPI
retry2Provides a decorator and function wrapper to…
permissive · top 5,000 on PyPI
waiterWaiter provides iteration-based retry and…
permissive · top 15,000 on PyPI
retry-decoratorProvides a decorator to automatically retry a…
permissive · top 15,000 on PyPI
backoff-utilsProvides functions and decorators to apply…
permissive · top 15,000 on PyPI