Skip to content

v0.1.1 — Initial Release Latest

Latest

Choose a tag to compare

@freq31 freq31 released this 29 Jun 07:10

Highlights

  • 3 rate-limiting algorithms: fixed window, sliding window log, token bucket
  • 2 backends: in-memory (asyncio.Lock) and Redis (atomic Lua scripts)
  • ASGI middleware: drop-in for FastAPI/Starlette with X-RateLimit-* headers, 429 + Retry-After, configurable fail-open/closed
  • Benchmarked: ~70k ops/s in-memory, ~27k ops/s distributed Redis
  • 55 tests: behavioral, integration (live Redis), concurrency, middleware, edge cases
  • CI: ruff + black + mypy + pytest with Redis service container

Install

pip install async-ratelimit

Full usage in README.md. Benchmark methodology in BENCHMARKS.md.