throttler
Zero-dependency Python package for easy throttling with asyncio support
What it is and what it does
Throttler is a zero-dependency Python package that provides four complementary tools for controlling execution timing and concurrency in asyncio programs. It exposes both context managers and decorators: Throttler enforces rate limits (e.g., 10 requests per second), ThrottlerSimultaneous caps concurrent tasks (e.g., at most 5 in-flight calls), ExecutionTimer enforces fixed spacing between iterations with optional wall-clock alignment, and Timer logs timing statistics across repeated operations.
The package is designed for scenarios where you need to respect API rate limits, prevent resource exhaustion from too many concurrent operations, or maintain consistent execution intervals. Throttler and ThrottlerSimultaneous are async-only and must run within an event loop, while ExecutionTimer and Timer support both sync and async usage. The implementation uses a sliding window for rate limiting and an async semaphore for concurrency control.
Use it for:
- Rate-limit API calls to respect external service quotas (e.g., 10 requests per 3 seconds).
- Cap concurrent async tasks to prevent overwhelming a resource pool (e.g., max 5 simultaneous HTTP requests).
- Enforce fixed-interval execution for periodic jobs (e.g., run a task once per minute, aligned to wall-clock).
- Measure and log timing statistics for repeated operations to identify performance regressions.
- Combine rate and concurrency limits for APIs that enforce both constraints simultaneously.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides rate limiting, concurrency limiting, execution timing, and performance monitoring for Python asyncio code through context managers and decorators.
Yes. Zero dependencies, active maintenance, MIT license, and broad Python version support (3.8–3.14) make it a low-risk choice. Install friction is minimal and the API is straightforward. Use it when you need rate limiting, concurrency control, or execution timing in asyncio code.
Install
throttler on PyPI
pip
pip install throttleruv
uv add throttlerpoetry
poetry add throttlerInstalling throttler
Before you install
Low friction: pure Python wheel with zero runtime dependencies and active maintenance (last commit 2026-05-19, 199 days since release).
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal attribution requirements.
Quickstart
pip install throttler
from throttler import Throttler
import asyncio
async def example():
t = Throttler(rate_limit=3, period=1.0)
async with t:
pass
asyncio.run(example())
Requires Python 3.8 or later; async context managers must run within an event loop.
Package facts
| License | MIT License Copyright (c) 2020 Ramzan Bekbulatov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 199 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,333,594/month — #4,039 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: throttler-1.2.3-py3-none-any.whl
Keywords: asyncio, aio-throttle, aiothrottle, aiothrottler, aiothrottling, asyncio-throttle, rate-limit, rate-limiter, throttling, throttle, throttler
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
asyncio-throttleProvides a simple async context manager to…
permissive · top 15,000 on PyPI
ratelimiterEnforces rate limiting on function calls and…
permissive · top 15,000 on PyPI
token-throttlerToken throttler implements rate limiting using…
permissive · top 15,000 on PyPI
asynciolimiterProvides rate limiting for async Python code by…
permissive · top 5,000 on PyPI
ratelimitA function decorator that enforces rate limits…
permissive · top 5,000 on PyPI
aiolimiterImplements a rate limiter for asyncio using the…
permissive · top 5,000 on PyPI
throttled-pyImplements rate limiting with multiple…
permissive · top 15,000 on PyPI
ratelimRatelim enforces rate limits on function calls…
permissive · top 5,000 on PyPI
stopwatch.pyProvides a simple stopwatch timer that measures…
permissive · top 15,000 on PyPI
codetimingMeasures elapsed time in Python code using a…
permissive · top 5,000 on PyPI