retry-decorator
Retry Decorator
What it is and what it does
retry-decorator is a simple Python decorator that wraps a function to automatically retry it when an exception occurs. You decorate a function with @retry, specifying the exception type to catch, the number of attempts to make, and a delay between retries in seconds. If all retries are exhausted, the last exception is raised to the caller.
The package has no runtime dependencies and works with both Python 2 and Python 3 according to its classifiers. However, the project is abandoned—the last release was in March 2020 and the last repository commit in December 2021—so it will not receive updates for compatibility issues or bug fixes.
Use it for:
- Wrap network requests that may fail transiently to automatically retry before giving up.
- Decorate database queries or API calls that occasionally time out or return temporary errors.
- Add resilience to file I/O operations that may fail due to temporary resource unavailability.
- Simplify test fixtures that need to wait for a service to become ready before proceeding.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a decorator to automatically retry a function when it raises an exception, with configurable attempt limits and timeout intervals.
No. The package is abandoned with no maintenance since 2021, and high install friction (source-only distribution). Modern Python projects should use the standard library's functools.wraps with explicit retry logic, or a maintained alternative like tenacity or backoff, which offer more features and active support.
Install
retry-decorator on PyPI
pip
pip install retry-decoratoruv
uv add retry-decoratorpoetry
poetry add retry-decoratorInstalling retry-decorator
Before you install
High install friction due to source distribution only. Package is abandoned—last release was 2020-03-10 and last commit 2021-12-11—so expect no maintenance response to issues or compatibility problems.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions.
Quickstart
from retry_decorator import retry
@retry(Exception, tries=3, timeout_secs=0.1)
def my_function():
# function body
pass
my_function()
Verify before relying
- Whether the decorator works correctly with modern Python versions (classifiers claim Python 2 and 3 support, but no requires_python constraint is specified).
- Whether timeout_secs parameter actually enforces a timeout or merely introduces a delay between retries.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,348 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 474,207/month — #6,455 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: retry_decorator-1.1.1.tar.gz
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
essentialsEssentials provides reusable core classes and…
permissive · top 15,000 on PyPI
timeout-decoratorA decorator that enforces time limits on…
permissive · top 5,000 on PyPI
retry2Provides a decorator and function wrapper to…
permissive · top 5,000 on PyPI
reretryA decorator and function wrapper for retrying…
permissive · top 15,000 on PyPI
awsretryA decorator that wraps AWS API calls to…
permissive · top 15,000 on PyPI
retryProvides a decorator and function wrapper for…
permissive · top 1,000 on PyPI
backoffProvides function decorators to automatically…
permissive · top 1,000 on PyPI
pybreakerPyBreaker wraps function calls with a circuit…
permissive · top 1,000 on PyPI
wrapt-timeout-decoratorApplies timeout limits to Python functions and…
permissive · top 5,000 on PyPI
strongtypingA runtime type-checking decorator that…
permissive · top 15,000 on PyPI