--- id: python-redis-rate-limit version: "0.0.10" license: MIT license_treatment: permissive maintenance: dormant --- # python-redis-rate-limit — Python Rate Limiter based on Redis. License: permissive · Maintenance: dormant · Downloads: 108.7K/mo ## 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 above — 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 pip install python-redis-rate-limit uv add python-redis-rate-limit poetry add python-redis-rate-limit ## Installing 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: unspecified - Install friction: high - Maintenance: dormant - Downloads: 108.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags redis rate limiting, request rate limiter, api throttling redis, rate limit per client, redis-backed rate limiting, request quota enforcement, distributed rate limiting, rate-limiting, redis-backed, distributed-systems [View on SkillFed](https://skillfed.io/packages/python-redis-rate-limit) · [View on PyPI](https://pypi.org/project/python-redis-rate-limit/)