python-redis-rate-limit
Python Rate Limiter based on Redis.
What it is and what it does
python-redis-rate-limit provides a simple abstraction for rate limiting on top of Redis, allowing you to enforce request quotas per client or resource. It works as a context manager or decorator, raising TooManyRequests when a limit is exceeded. You define a resource name, client identifier, maximum requests, and optional time window (expire), and the package tracks request counts in Redis, automatically resetting them when the window expires.
The package is designed for distributed systems where multiple application instances need to share rate-limit state. It has no runtime dependencies—you supply your own Redis connection or pool—and supports both simple one-off limits and a factory pattern for reusable limiters. Maintenance is dormant but the codebase is stable; the last commit was 2024-10-23 but preceded by a long gap, indicating the package is mature and not under active development.
Use it for:
- Protect API endpoints from abuse by limiting requests per IP address or user ID to a fixed quota per second, minute, or hour.
- Enforce fair-use quotas in multi-tenant systems where each tenant has a separate rate limit tracked across distributed servers.
- Implement sliding-window rate limiting for background job workers or scheduled tasks that consume shared resources.
- Add rate limiting to individual functions or methods without rewriting core logic using the decorator pattern.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements rate limiting for requests or operations using Redis as the backend store, supporting per-client and per-resource limits with configurable time windows.
Yes, if you already run Redis and need straightforward per-client rate limiting. The package is stable, has no external Python dependencies, and the MIT license is unrestricted. The main trade-off is dormant maintenance—no active development, so expect to fork or patch if you need new features or encounter bugs. High install friction due to the Redis dependency is acceptable for projects that already use Redis.
Install
python-redis-rate-limit on PyPI
pip
pip install python-redis-rate-limituv
uv add python-redis-rate-limitpoetry
poetry add python-redis-rate-limitInstalling python-redis-rate-limit
Before you install
High install friction: no runtime dependencies declared, but requires an external Redis server (>= 2.6.0) to function. Maintenance is dormant—last commit was 2024-10-23 but preceded by a 660-day gap, suggesting the package is stable but not actively developed.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install python-redis-rate-limit
from redis_rate_limit import RateLimit, TooManyRequests
try:
with RateLimit(resource='users_list', client='192.168.0.10', max_requests=10):
return '200 OK'
except TooManyRequests:
return '429 Too Many Requests'
Requires a running Redis server (>= 2.6.0) accessible from the application; no built-in fallback or in-memory alternative.
Verify before relying
- Whether the package works with modern Redis versions beyond 2.6.0 or has compatibility limits.
- Performance characteristics under high concurrency or large numbers of tracked clients.
- Whether Python 2.7 support is still functional or if it has bitrotted.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 660 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 108,702/month — #12,544 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python-redis-rate-limit-0.0.10.tar.gz
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
asgi-ratelimitAn ASGI middleware that enforces rate limits on…
permissive · top 15,000 on PyPI
upstash-ratelimitProvides connectionless rate limiting for…
permissive · top 15,000 on PyPI
ratelimiterEnforces rate limiting on function calls and…
permissive · top 15,000 on PyPI
ratelimitA function decorator that enforces rate limits…
permissive · top 5,000 on PyPI
fastapi-limiterAdds request rate limiting to FastAPI routes…
permissive · top 5,000 on PyPI
requests-ratelimiterAdds rate-limiting to the requests library by…
permissive · top 5,000 on PyPI
loop-rate-limitersProvides synchronous and asynchronous rate…
permissive · top 15,000 on PyPI
Flask-LimiterFlask-Limiter adds rate limiting to Flask…
permissive · top 1,000 on PyPI
rushrush provides rate-limiting algorithms…
permissive · top 15,000 on PyPI
pyrate-limiterPyrateLimiter implements the Leaky-Bucket…
permissive · top 5,000 on PyPI