Project description
HTTPX Retry - Middleware for implementing retry policies with HTTPX
Usage
Retries are defined at the transport layer.
import httpx
from httpx_retry import RetryTransport, RetryPolicy
exponential_retry = (
RetryPolicy()
.with_max_retries(3)
.with_min_delay(0.1)
.with_multiplier(2)
.with_retry_on(lambda status_code: status_code >= 500)
)
client = httpx.Client(transport=RetryTransport(policy=exponential_retry))
res = client.get("https://example.com")
Examples
There are examples of implementing common retry policies in /tests
Installation

Available in PyPI
pip install httpx-retry
License

See LICENSE for more info.
Contributing

See CONTRIBUTING.md for info on PRs, issues, and feature requests.
Changelog
See CHANGELOG.md for summarized notes on changes or view releases for more details information on changes.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file httpx_retry-0.3.0.tar.gz
.
File metadata
-
Download URL:
httpx_retry-0.3.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
-
Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Darwin/24.3.0
File hashes
Hashes for httpx_retry-0.3.0.tar.gz
Algorithm |
Hash digest |
|
SHA256 |
7ffc6d6c4fb22cd50a637ff4e41effc2ce01ead4b83a411e25da5af899f7f0d7 |
|
MD5 |
887e91bb8e4175c1cbe4d794c5018161 |
|
BLAKE2b-256 |
1b5572a6b7e02eca5b5c7391f3ec432a4aa07bdeb84fc93c2bad2b389a920678 |
|
See more details on using hashes here.
File details
Details for the file httpx_retry-0.3.0-py3-none-any.whl
.
File metadata
-
Download URL:
httpx_retry-0.3.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
-
Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Darwin/24.3.0
File hashes
Hashes for httpx_retry-0.3.0-py3-none-any.whl
Algorithm |
Hash digest |
|
SHA256 |
dbaf97cd883796f6ea195a46253cf197976611c65e7adb9177410ee81e6dea5a |
|
MD5 |
8b3f1601b9397ba5b44cec8277e49dca |
|
BLAKE2b-256 |
3c66df398240e3bec71d0578a74d08cbadcb6eafb6d06e06da4ed6804d34fae1 |
|
See more details on using hashes here.