skillfed

retry-decorator

Retry Decorator

retry-decorator v1.1.1 474.2K downloads/30d#6,455 on PyPI27
Permissive license MIT Abandoned released

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-decorator

uv

uv add retry-decorator

poetry

poetry add retry-decorator

Installing 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

Programming Language :: Python :: 2Programming Language :: Python :: 3

Tags

retry decoratorautomatic retry on exceptionfunction retry logicretry with timeoutexception retry handler
error-handlingdecorator

More Software Development packages