skillfed

redo

Utilities to retry Python callables.

redo v3.0.0 1.0M downloads/30d#4,528 on PyPI101
Copyleft license MPL-2.0 Active released

What it is and what it does

Redo is a retry utility library that wraps Python functions to automatically retry them on failure with configurable backoff strategies. It offers multiple integration points: plain functions (retry, retry_async), decorators (retriable, retriable_async), and a context manager (retrying) so you can choose the pattern that fits your codebase. Each retry attempt can be separated by a sleep interval that grows exponentially with optional random jitter to avoid thundering herd problems.

The package handles both synchronous and asynchronous callables, lets you specify which exceptions trigger a retry versus which should fail immediately, and supports optional cleanup functions between attempts. It has no runtime dependencies and supports Python 3.8 through 3.12, making it lightweight to add to existing projects.

Use it for:

  • Wrap unreliable network requests with automatic retry and exponential backoff to handle transient failures gracefully.
  • Decorate database operations that may fail due to temporary locks or connection issues, with configurable sleep between attempts.
  • Use as a context manager around a block of code that needs retry logic without modifying the function definition itself.
  • Retry async/await functions in concurrent applications with sleep callbacks tuned to your workload.
  • Add retry capability to CLI tools or scripts that interact with flaky external services or resources.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Redo provides decorators, functions, and a context manager to automatically retry Python callables with exponential backoff, jitter, and configurable attempt limits.

Yes. Redo is a mature, dependency-free utility with active maintenance, no known vulnerabilities, and broad Python version support. It solves a common problem (retrying transient failures) with multiple clean integration patterns. The MPL-2.0 copyleft license is permissive for most use cases. Install it if you need retry logic and prefer a focused, lightweight tool over building your own.

Install

redo on PyPI

pip

pip install redo

uv

uv add redo

poetry

poetry add redo

Installing redo

Before you install

Low install friction with no runtime dependencies. Actively maintained as of 2026-08-04 with a recent release in 2024-07-17, supporting Python 3.8 through 3.12.

License in practice

Licensed under MPL-2.0 (copyleft). You must disclose source code modifications and distribute under the same license if you modify and redistribute the package, but can use it in proprietary applications without disclosing your own code.

Quickstart

pip install redo

from redo import retry

def unstable_action():
    # raises Exception on failure
    pass

result = retry(unstable_action, attempts=5, sleeptime=1, jitter=0)

Verify before relying

  • Whether the package is actively maintained beyond the last commit date of 2026-08-04
  • Performance characteristics when handling high-frequency retries or very large numbers of attempts

Package facts

License MPL-2.0 (copyleft)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 758 days since the last release
Last repo commit
First released
Downloads 1,005,604/month — #4,528 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: redo-3.0.0-py2.py3-none-any.whl

License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

retry decorator pythonexponential backoff retryasync retry functionautomatic retry with backoffpython retry utilitiesretry context managerconfigurable retry attempts
retry-logicasync-supporterror-handling

More Application Frameworks packages