u/Away-Range-5276

I built a production-ready Python rate limiter with 6 algorithms and adaptive load-sensing.
▲ 5 r/flask

I built a production-ready Python rate limiter with 6 algorithms and adaptive load-sensing.

I just open-sourced smart-ratelimiter, a production-ready Python rate limiting library. Would love feedback from the community.

What it does:

Provides rate limiting for Python APIs and services. Most libraries give you one algorithm — this gives you six, all behind a consistent API with swappable storage backends.

Algorithms:

Fixed Window, Sliding Window Log, Sliding Window Counter

Token Bucket, Leaky Bucket

Adaptive Hybrid — auto-tightens under high load, relaxes when quiet. No manual tuning.

Backends: In-memory · Redis · SQLite

Usage:

pip install smart-ratelimiter

from ratelimiter import AdaptiveRateLimiter, MemoryBackend

limiter = AdaptiveRateLimiter(MemoryBackend(), limit=100, window=60)

result = limiter.is_allowed("user:42")

Links:

GitHub: https://github.com/himanshu9209/ratelimiter

PyPI: https://pypi.org/project/smart-ratelimiter/

Zero required dependencies. MIT licensed. Contributions welcome!

u/Away-Range-5276 — 14 days ago