A Redis based rate limiter implementation for Python
Project description
redis-rate-limiter
Install
pip install -U redis-rate-limiter
Use
from redis_rate_limiter.config import basic_config
from redis_rate_limiter.rate_limiter import RateLimiter
basic_config(redis_url='redis://localhost:6379/0')
@RateLimiter(10, period=1)
def greet():
print('Hello')
for _ in range(100):
greet()
# Raise RateLimitExceeded after print('Hello') 10 times
Project details
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 redis-rate-limiter-0.2.0.tar.gz
.
File metadata
- Download URL: redis-rate-limiter-0.2.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.8.13 Linux/5.15.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89dbc9648881ec885b52717b0773f5638335d90623eadea4fc96261040bc6920 |
|
MD5 | 91d736a4be35c69ec6c2dbb63c12c374 |
|
BLAKE2b-256 | 4ebb793d87c8a52757072d115a423d3fc0498fb3610b2ac331cd6f6dd380c933 |
File details
Details for the file redis_rate_limiter-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: redis_rate_limiter-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.8.13 Linux/5.15.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 139a34c9743eb26a69779f87c7d94b1894319479c8b03651dbecbb93634da204 |
|
MD5 | 410dccb4b4fd348a506747053328056e |
|
BLAKE2b-256 | a5f520e247fa3cd7d4a9f38d94b859a76bb505c9e1f5ff2f27368a6353e2824b |