{"id":23176,"library":"the-retry","title":"the-retry","description":"A simple retry decorator for both synchronous and asynchronous functions in Python. Current version 0.1.1, released 2024. Supports configurable retries, delays, backoff, and exception filtering. Low release cadence (last update 2024-09).","status":"active","version":"0.1.1","language":"python","source_language":"en","source_url":"https://github.com/khoubaibk/the-retry","tags":["retry","decorator","async"],"install":[{"cmd":"pip install the-retry","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Package name uses hyphens on PyPI but underscore in import","symbol":"retry","correct":"from the_retry import retry"},{"note":"AsyncRetryable is directly available from the_retry, not a submodule","wrong":"from the_retry.async_retry import AsyncRetryable","symbol":"AsyncRetryable","correct":"from the_retry import AsyncRetryable"}],"quickstart":{"code":"from the_retry import retry\nimport os\n\n@retry(max_retries=3, delay=1, backoff=2, exceptions=(ConnectionError, TimeoutError))\ndef fetch_data(url: str) -> str:\n    return \"data\"\n\nresult = fetch_data(\"https://example.com\")\nprint(result)","lang":"python","description":"Quickstart: basic usage of the retry decorator with sync function."},"warnings":[{"fix":"Use `from the_retry import retry`","message":"The package name uses hyphens on PyPI but underscores in Python imports. Use `import the_retry` not `import the-retry`.","severity":"gotcha","affected_versions":"all"},{"fix":"Add `delay=1` or desired delay to decorator","message":"The `delay` parameter default is 0, not 1. If you expect a small delay, set it explicitly.","severity":"gotcha","affected_versions":"<=0.1.1"},{"fix":"Replace `retry_count` with `max_retries`","message":"The `retry_count` parameter is deprecated in favor of `max_retries`.","severity":"deprecated","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install the-retry` and import as `from the_retry import retry`","cause":"Package installed with pip but import uses hyphens or wrong name.","error":"ModuleNotFoundError: No module named 'the_retry'"},{"fix":"Replace `retry_count` with `max_retries`","cause":"Deprecated parameter `retry_count` used in newer version.","error":"TypeError: retry() got an unexpected keyword argument 'retry_count'"},{"fix":"Import AsyncRetryable directly: `from the_retry import AsyncRetryable`","cause":"Trying to import a non-existent submodule.","error":"AttributeError: module 'the_retry' has no attribute 'async_retry'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}