--- id: python-retry version: "0.0.1" license: MIT License license_treatment: permissive maintenance: dormant --- # python-retry — Retry package for Python License: permissive · Maintenance: dormant · Downloads: 138.8K/mo ## What it is and what it does Python Retry is a lightweight decorator library that wraps function calls to automatically retry them when they fail. It lets you specify how many times to retry, what exceptions should trigger a retry, and how long to wait between attempts—including exponential backoff. The package has no runtime dependencies, making it a minimal addition to any project that needs resilience against transient failures. You apply it as a simple decorator above any function, optionally tuning its behavior with parameters like max_retries, backoff_factor, and retry_on to filter which exceptions warrant a retry. It can also suppress exceptions entirely and log retry attempts to a logger you provide. Use it for: - Wrap API calls that may fail transiently, retrying with exponential backoff before giving up - Protect database queries or network operations from temporary connectivity issues - Add resilience to file I/O operations that might fail due to transient system conditions - Implement retry logic in test fixtures or setup/teardown code without rewriting the function ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a decorator to automatically retry failed function calls with configurable stop conditions, wait strategies, and exception filtering. Yes, if you need basic retry logic without external dependencies. The package is simple and permissively licensed. However, maintenance is dormant (no updates since 2022-03-11), so verify compatibility with your Python version and consider whether a more actively maintained alternative better suits long-term projects. ## Install pip install python-retry uv add python-retry poetry add python-retry ## Installing python-retry Before you install: Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2022-03-11 with no updates since, though the repository remains active and has received a recent commit (2024-04-12). License in practice: MIT License permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open-source and proprietary projects. Quickstart: pip install python-retry from python_retry import retry @retry(max_retries=2, backoff_factor=1) def call_api(): # function body pass call_api() Requires Python 3.6 or later (package specifies requires_python >= 3.6). Verify before relying: - Whether the package handles async/await functions or only synchronous callables - Current test coverage and whether the test suite remains passing under modern Python versions ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 138.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags retry decorator python, automatic retry logic, exponential backoff retry, exception retry handler, function retry wrapper, resilience, decorator, error-handling [View on SkillFed](https://skillfed.io/packages/python-retry) · [View on PyPI](https://pypi.org/project/python-retry/)