Skip to main content

A Redis based rate limiter implementation for Python

Project description

redis-rate-limiter

CI

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

redis-rate-limiter-0.2.0.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

redis_rate_limiter-0.2.0-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page