Registry / http-networking / the-retry

the-retry

JSON →
library0.1.1pypypi✓ verified 85d ago

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).

pip install the-retry
INSTALL
IMPORT
SIG · THE-RETRY
T
the-retry
http-networkingpythonv0.1.1
Install
1.5s avg
Import
209ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.224s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.194s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

retry
from the_retry import retry
Package name uses hyphens on PyPI but underscore in import
AsyncRetryable
from the_retry import AsyncRetryable
from the_retry.async_retry import AsyncRetryable
AsyncRetryable is directly available from the_retry, not a submodule

Quickstart: basic usage of the retry decorator with sync function.

from the_retry import retry import os @retry(max_retries=3, delay=1, backoff=2, exceptions=(ConnectionError, TimeoutError)) def fetch_data(url: str) -> str: return "data" result = fetch_data("https://example.com") print(result)
Debug
Known issues
gotchaThe package name uses hyphens on PyPI but underscores in Python imports. Use `import the_retry` not `import the-retry`.
fix
Use `from the_retry import retry`
affects: all
gotchaThe `delay` parameter default is 0, not 1. If you expect a small delay, set it explicitly.
fix
Add `delay=1` or desired delay to decorator
affects: <=0.1.1
deprecatedThe `retry_count` parameter is deprecated in favor of `max_retries`.
fix
Replace `retry_count` with `max_retries`
affects: >=0.1.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'the_retry'
Package installed with pip but import uses hyphens or wrong name.
fix
Run `pip install the-retry` and import as `from the_retry import retry`
TypeError: retry() got an unexpected keyword argument 'retry_count'
Deprecated parameter `retry_count` used in newer version.
fix
Replace `retry_count` with `max_retries`
AttributeError: module 'the_retry' has no attribute 'async_retry'
Trying to import a non-existent submodule.
fix
Import AsyncRetryable directly: `from the_retry import AsyncRetryable`
Upgrade
Version history
0.1.1latest on PyPI · released Jan 16, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
the-retry — pip install the-retry · libregistry