requests-ratelimit-adapter
A ratelimiting Session adapter for requests.
- Free software: MIT license
- Documentation: https://requests-ratelimit-adapter.readthedocs.io.
Example
>>> from requests_ratelimit_adapter import HTTPRateLimitAdapter
>>> import requests
>>> import time
>>> # Create a rate limiting adapter
>>> rate_limiter = HTTPRateLimitAdapter(calls=1, period=1)
>>> s = requests.Session()
>>> s.mount("https://", rate_limiter)
>>> # This first request will start the period.
>>> r = s.get("https://httpbin.org/get")
>>> r.raise_for_status()
>>> time1 = time.time()
>>> # This second request will wait 1 second before executing.
>>> r2 = s.get("https://httpbin.org/get")
>>> r2.raise_for_status()
>>> time2 = time.time()
>>> # For this example, verify the timestamps are more than a second apart.
>>> assert time2 >= time1 + 1
Credits
This package was created with Cookiecutter and the cmeister2/cookiecutter-pypackage project template.
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
Changed
0.2.0 - 2019-01-06
Added
- Wrap the HTTPAdapter code from
requestsso there's less boilerplate.
0.1.2 - 2018-12-24
Changed
- Use the correct travis password for deploying to PyPI.
0.1.1 - 2018-12-24
Added
- Add travis password for deploying to PyPI.
0.1.0 - 2018-12-24
Added
- Initial commit of code.
Metadata
Release files for requests-ratelimit-adapter 0.2.0
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 | Actions |
|---|---|---|---|---|
| requests_ratelimit_adapter-0.2.0.tar.gz | 10.6 kB | Without provenance | Details for requests_ratelimit_adapter-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| requests_ratelimit_adapter-0.2.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for requests_ratelimit_adapter-0.2.0-py2.py3-none-any.whl |
Total release size: 16.5 kB
Release files / requests_ratelimit_adapter-0.2.0.tar.gz
| Download URL | requests_ratelimit_adapter-0.2.0.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4400321266002916646da0b64b1a89eedc4a0bf2e42e8834b1245e6ed081095
|
|
BLAKE2b-256 checksum How to use checksums |
1532e95f370e1921af9406960a273bbc848590ef953f833c61d0bc9d03657fae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.3
|
Release files / requests_ratelimit_adapter-0.2.0-py2.py3-none-any.whl
| Download URL | requests_ratelimit_adapter-0.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e21792f57c3e9ddb10d5d4cb9c85585cb76164ea21b2cadfa2741f4cdeff5aa5
|
|
BLAKE2b-256 checksum How to use checksums |
e57fc59b619b0564b410e4048167fa1dca34c1470e092170f909abe944e56a7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.3
|
Security for requests-ratelimit-adapter 0.2.0
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.