retrying
Retrying
Install
retrying on PyPI
pip
pip install retryinguv
uv add retryingpoetry
poetry add retryingPackage facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 375 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: retrying-1.4.2-py3-none-any.whl
Keywords: decorator, decorators, retry, retrying, exception, exponential, backoff
About retrying
from the package's own PyPI description — quoted content, verbatim
Retrying
Retrying is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just about anything.
The simplest use case is retrying a flaky function whenever an Exception occurs until a value is returned.
import random
from retrying import retry
@retry
def do_something_unreliable():
if random.randint(0, 10) > 1:
raise IOError("Broken sauce, everything is hosed!!!111one")
else:
return "Awesome sauce!"
print(do_something_unreliable())
Features
- Generic Decorator API
- Specify stop condition (i.e. limit by number of attempts)
- Specify wait condition (i.e. exponential backoff sleeping between attempts)
- Customize retrying on Exceptions
- Customize retrying on expected returned result
Examples
As you saw above, the default behavior is to retry forever without waiting.
@retry
def never_give_up_never_surrender():
print("Retry forever ignoring Exceptions, don't wait between retries")
Let's be a little less persistent and set some boundaries, such as the number of attempts before giving up.
```python @retry(stop_max_attempt_number=7) def...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Retrying is a decorator-based library that adds automatic retry logic to functions, supporting configurable stop conditions (attempt limits, time bounds), wait strategies (fixed delays, exponential backoff, random intervals), and exception/result-based retry decisions.
Low friction: pure Python wheel with no runtime dependencies and active maintenance (last commit 2026-07-26). Supports Python 3.6–3.13.
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; attribution required.
Usage
from retrying import retry
@retry(stop_max_attempt_number=3, wait_fixed=1000)
def flaky_operation():
# function body
pass
flaky_operation()
Verdict: Retrying is a lightweight, actively maintained retry utility with zero dependencies, permissive licensing, and broad Python version support. No known vulnerabilities and top-1000 popularity make it a low-risk choice for adding resilience to flaky operations.
Needs verification
- Whether the package is still actively developed beyond the last commit date (2026-07-26 appears future-dated; clarify actual maintenance cadence)
- Performance characteristics under high-frequency retry scenarios with exponential backoff
- Compatibility with async/await patterns or whether it is synchronous-only
Similar packages
permissive · top 1,000 on PyPI
tenacitypermissive · top 100 on PyPI
pytest-rerunfailurescopyleft · top 1,000 on PyPI
azure-coreunclear · top 1,000 on PyPI
backoffpermissive · top 1,000 on PyPI
retrypermissive · top 1,000 on PyPI
hypothesiscopyleft · top 1,000 on PyPI
boltonspermissive · top 1,000 on PyPI
pytest-json-ctrfpermissive · top 1,000 on PyPI
httpx-ssepermissive · top 1,000 on PyPI