skillfed

aiolimiter

asyncio rate limiter, a leaky bucket implementation

aiolimiter v1.2.1 12.5M downloads/30d#1,316 on PyPI776
Permissive license MIT Active released

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 aiolimiter

uv

uv add aiolimiter

poetry

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 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

Framework :: AsyncIOIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

asyncio rate limitingleaky bucket algorithmasync concurrency controlrate limiter for coroutinesasyncio throttlingconcurrent request limiting
asyncioconcurrency-controlrate-limiting

More Software Development packages