aiolimiter
asyncio rate limiter, a leaky bucket implementation
What it is and what it does
aiolimiter provides a rate limiter for asyncio applications using the leaky bucket algorithm. It lets you specify a maximum number of concurrent entries into a code section within a given time window, which is useful for controlling how fast async operations execute—for example, limiting API calls, database queries, or other I/O-bound tasks.
The package is a pure Python implementation with no external runtime dependencies, making it lightweight and easy to integrate. It's designed for developers building asyncio applications who need fine-grained control over concurrency and throughput without adding complexity or external service dependencies.
Use it for:
- Limit concurrent API requests to a third-party service to avoid hitting rate limits or overwhelming the server.
- Control database query concurrency to prevent connection pool exhaustion in async applications.
- Throttle background task execution to spread load evenly across a time window.
- Prevent resource exhaustion by capping how many async operations can run simultaneously.
- Implement fair-share scheduling for multiple concurrent coroutines competing for a shared resource.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements a rate limiter for asyncio using the leaky bucket algorithm, allowing you to control how often a code section executes within a time window.
Yes. aiolimiter is a lightweight, actively maintained rate-limiting tool with no dependencies, permissive licensing, and broad Python version support. It solves a common problem in asyncio applications with a proven algorithm and straightforward API. Install it if you need to control concurrency or throughput in async code.
Install
aiolimiter on PyPI
pip
pip install aiolimiteruv
uv add aiolimiterpoetry
poetry add aiolimiterInstalling aiolimiter
Before you install
Low install friction with no runtime dependencies. Actively maintained with recent commits and broad Python version support from 3.8 through 3.13.
License in practice
MIT license is permissive; you can use this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install aiolimiter
from aiolimiter import AsyncLimiter
rate_limit = AsyncLimiter(100, 30)
async def some_coroutine():
async with rate_limit:
await do_something()
Requires Python 3.8 or newer.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 614 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 12,500,767/month — #1,316 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiolimiter-1.2.1-py3-none-any.whl
Keywords: asyncio, rate-limiting, leaky-bucket
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
asynciolimiterProvides rate limiting for async Python code by…
permissive · top 5,000 on PyPI
throttled-pyImplements rate limiting with multiple…
permissive · top 15,000 on PyPI
pyrate-limiterPyrateLimiter implements the Leaky-Bucket…
permissive · top 5,000 on PyPI
asyncio-throttleProvides a simple async context manager to…
permissive · top 15,000 on PyPI
rushrush provides rate-limiting algorithms…
permissive · top 15,000 on PyPI
loop-rate-limitersProvides synchronous and asynchronous rate…
permissive · top 15,000 on PyPI
httpx-limiterProvides rate-limited HTTP transports for httpx…
permissive · top 15,000 on PyPI
throttlerProvides rate limiting, concurrency limiting,…
permissive · top 5,000 on PyPI
requests-ratelimiterAdds rate-limiting to the requests library by…
permissive · top 5,000 on PyPI
ratelimiterEnforces rate limiting on function calls and…
permissive · top 15,000 on PyPI