redis-ratelimit
A fixed window rate limiter based on Redis
Installation
$ pip install redis-ratelimit
Example Usage
The library itself is framework agnostic, but let's assume you want to use it with Flask:
from flask import Flask, jsonify
from redis_ratelimit import ratelimit
app = Flask(__name__)
@app.route('/')
@ratelimit(rate='10/m', key='ccc')
@ratelimit(rate='2/s', key='ccc')
def index():
return jsonify({'status': 'OK'})
This will allow a total of 10 requests in any given minute, but no faster than 2 requests a second.
Notes
License
MIT
Metadata
Release files for redis-ratelimit 1.0.3
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 |
|---|---|---|---|---|
| redis-ratelimit-1.0.3.tar.gz | 3.0 kB | Without provenance | Details for redis-ratelimit-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| redis_ratelimit-1.0.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for redis_ratelimit-1.0.3-py2.py3-none-any.whl |
Total release size: 6.5 kB
Release files / redis-ratelimit-1.0.3.tar.gz
| Download URL | redis-ratelimit-1.0.3.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
088edb6ad0380e0c485f773d1831aaccfff2d8dc56bb63a3cabf97969f37ebb1
|
|
BLAKE2b-256 checksum How to use checksums |
f60d922b759b80a16ece58619e4d0c605c7351f2ffe7c37e1692178929678ebe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / redis_ratelimit-1.0.3-py2.py3-none-any.whl
| Download URL | redis_ratelimit-1.0.3-py2.py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
db0fb15c8e1170d03255b4776de8c4adfbb39bd7d8f96712cee0076e52dfbceb
|
|
BLAKE2b-256 checksum How to use checksums |
4f6ab3e918eb9e39f473aaa45c7beb59d99a68be4911cdf065e6446512121ba5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for redis-ratelimit 1.0.3
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.