--- id: throttler version: "1.2.3" 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) license_treatment: permissive maintenance: active --- # throttler — Zero-dependency Python package for easy throttling with asyncio support License: permissive · Maintenance: active · Downloads: 1.3M/mo ## 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 above — 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 pip install throttler uv add throttler poetry add throttler ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 1.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags asyncio rate limiting, throttle async functions, concurrency limiter, rate limiter python, async throttler, execution timing, api rate limiting, asyncio, rate-limiting, concurrency-control [View on SkillFed](https://skillfed.io/packages/throttler) · [View on PyPI](https://pypi.org/project/throttler/)