skillfed

ratelim

Makes it easy to respect rate limits.

ratelim v0.1.6 3.1M downloads/30d#2,739 on PyPI96
Permissive license MIT Abandoned released

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 ratelim

uv

uv add ratelim

poetry

poetry add ratelim

Installing 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

rate limiting decoratorapi rate limit enforcementfunction call throttlingrate limiter pythonlimit calls per secondapi throttle decoratorgreedy patient rate limiting
rate-limitingapi-throttlingdecorator

More Utilities packages