ratelim
Makes it easy to respect rate limits.
What it is and what it does
Ratelim is a lightweight decorator library that restricts how often a function can be called within a given time interval. It provides two strategies: greedy rate limiting, which delays calls only when necessary, and patient rate limiting, which distributes calls evenly across the time window. The library is designed primarily for API interactions where rate limits are enforced by the service provider.
The package depends only on decorator and installs as a pure Python wheel with no compiled dependencies. It preserves the decorated function's signature, making it transparent to call. The project has not been updated since 2015-02-27, so it will not receive updates for Python language changes or new best practices.
Use it for:
- Throttle API calls to a web service that enforces rate limits on requests per second or minute
- Distribute database queries evenly over time to avoid overwhelming a backend service
- Limit function execution frequency in web scrapers to respect server policies and avoid IP bans
- Enforce call quotas on internal functions to prevent resource exhaustion in multi-threaded applications
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Ratelim enforces rate limits on function calls by decorating them to restrict execution frequency to a specified number of calls within a time window.
Yes, if you need simple rate limiting for legacy Python code or a straightforward API throttling decorator and can tolerate no ongoing maintenance. The low install friction and permissive license make it a minimal risk, but the codebase has not been updated since 2015-02-27, so verify compatibility with your Python version and consider whether a maintained alternative better suits new projects.
Install
ratelim on PyPI
pip
pip install ratelimuv
uv add ratelimpoetry
poetry add ratelimInstalling ratelim
Before you install
Installation is straightforward with no complex dependencies—only decorator is required. However, the package has been abandoned since its latest release on 2015-02-27 with no updates since, so it receives no maintenance or security patches.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions, making it safe to adopt from a licensing standpoint.
Quickstart
pip install ratelim
import ratelim
@ratelim.greedy(10, 5)
def hello():
print("hello")
Verify before relying
- Whether the package remains compatible with current Python versions despite no recent releases
- Whether greedy vs. patient rate limiting strategies meet specific API throttling requirements in modern use cases
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — decorator |
| Maintenance | abandoned — 4,186 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,124,515/month — #2,739 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ratelim-0.1.6-py2.py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
ratelimitA function decorator that enforces rate limits…
permissive · top 5,000 on PyPI
ratelimiterEnforces rate limiting on function calls and…
permissive · top 15,000 on PyPI
asynciolimiterProvides rate limiting for async Python code by…
permissive · top 5,000 on PyPI
limitsImplements rate limiting with multiple…
permissive · top 1,000 on PyPI
loop-rate-limitersProvides synchronous and asynchronous rate…
permissive · top 15,000 on PyPI
django-ratelimitProvides a Django decorator to rate-limit views…
permissive · top 5,000 on PyPI
requests-ratelimiterAdds rate-limiting to the requests library by…
permissive · top 5,000 on PyPI
fastapi-limiterAdds request rate limiting to FastAPI routes…
permissive · top 5,000 on PyPI
upstash-ratelimitProvides connectionless rate limiting for…
permissive · top 15,000 on PyPI
marketorestpythonPython client library that wraps the Marketo…
permissive · top 15,000 on PyPI