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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for redis-rate-limiter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 89dbc9648881ec885b52717b0773f5638335d90623eadea4fc96261040bc6920
MD5 91d736a4be35c69ec6c2dbb63c12c374
BLAKE2b-256 4ebb793d87c8a52757072d115a423d3fc0498fb3610b2ac331cd6f6dd380c933

See more details on using hashes here.

File details

Details for the file redis_rate_limiter-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for redis_rate_limiter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 139a34c9743eb26a69779f87c7d94b1894319479c8b03651dbecbb93634da204
MD5 410dccb4b4fd348a506747053328056e
BLAKE2b-256 a5f520e247fa3cd7d4a9f38d94b859a76bb505c9e1f5ff2f27368a6353e2824b

See more details on using hashes here.

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