--- id: aiolimiter version: "1.2.1" license: MIT license_treatment: permissive maintenance: active --- # aiolimiter — asyncio rate limiter, a leaky bucket implementation License: permissive · Maintenance: active · Downloads: 12.5M/mo ## 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 above — 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 pip install aiolimiter uv add aiolimiter poetry add aiolimiter ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 12.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags asyncio rate limiting, leaky bucket algorithm, async concurrency control, rate limiter for coroutines, asyncio throttling, concurrent request limiting, asyncio, concurrency-control, rate-limiting [View on SkillFed](https://skillfed.io/packages/aiolimiter) · [View on PyPI](https://pypi.org/project/aiolimiter/)