skillfed

retrying

Retrying

retrying Permissive license Apache-2.0 Active 96 v1.4.2 released

Install

retrying on PyPI

pip

pip install retrying

uv

uv add retrying

poetry

poetry add retrying

Package 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

Intended Audience :: DevelopersNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: InternetTopic :: Utilities

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
retry decorator pythonexponential backoff libraryautomatic retry logicfunction retry with backoffexception retry handlerconfigurable retry attemptsdistributed service retry

Similar packages