skillfed

python-redis-rate-limit

Python Rate Limiter based on Redis.

python-redis-rate-limit v0.0.10 108.7K downloads/30d#12,544 on PyPI133
Permissive license MIT DORMANT released

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-limit

uv

uv add python-redis-rate-limit

poetry

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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

redis rate limitingrequest rate limiterapi throttling redisrate limit per clientredis-backed rate limitingrequest quota enforcementdistributed rate limiting
rate-limitingredis-backeddistributed-systems

More WWW/HTTP packages