retryable-requests
Easy to use retryable requests sessions.
Quickstart
Common case
from retryable_requests import RetryableSession
with RetryableSession() as session:
session.get('https://httpbin.org/get') # will be retried up to 5 times
Only retry on 429 errors
from requests.packages.urllib3.util.retry import Retry
from retryable_requests import RetryableSession
retry_strategy = Retry(
total=5,
status_forcelist=[429],
backoff_factor=0.1,
)
with RetryableSession(retry_strategy=retry_strategy) as session:
session.get('https://httpbin.org/get') # will be retried up to 5 times, only for 429 errors
Automatically use a base URL for every request
from retryable_requests import RetryableSession
with RetryableSession('https://httpbin.org/') as session:
session.get('get') # 'https://httpbin.org/get' will be retried up to 5 times
session.post('post') # 'https://httpbin.org/post' won't be retried (POST request)
Features
- Automatic backing off retries for failed requests that can be safely retried
- Quick timeouts for non-responsive requests
See also
Metadata
Release files for retryable-requests 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| retryable-requests-0.1.2.tar.gz | 10.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| retryable_requests-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.7 kB
Release files / retryable-requests-0.1.2.tar.gz
| Download URL | retryable-requests-0.1.2.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4d08923de1fe4a4805ec2677004ece16fa59fac2827a094011a4feeba2b3d48
|
|
BLAKE2b-256 checksum How to use checksums |
37097cad4599ef773378870639c765fcc9035845beb8efcac46fe96b46e124f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / retryable_requests-0.1.2-py3-none-any.whl
| Download URL | retryable_requests-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce70858edc571c964260ca5b4fc1cd6e5fe0193b546430988531e212654fef0f
|
|
BLAKE2b-256 checksum How to use checksums |
4704a08e1df9c8a95a16b770c61379d61d18d0bb6821e364c694e9625165f2cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for retryable-requests 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.