loop-rate-limiters
Loop rate limiters.
What it is and what it does
Loop rate limiters provides simple frequency regulation for tight loops in Python, offering both synchronous and asynchronous variants. The synchronous RateLimiter class accepts a frequency parameter and sleeps for the appropriate duration each iteration to maintain that rate; the AsyncRateLimiter does the same for asyncio-based code. Both are designed to work similarly to rospy.Rate, making them useful for robotics, control systems, and any application that needs to run a loop at a fixed frequency without busy-waiting.
The package has no external dependencies and supports Python 3.9 through 3.12. It is actively maintained and classified as production-stable, making it suitable for production use in timing-sensitive applications where you need straightforward frequency control without the complexity of a full scheduler.
Use it for:
- Robotics control loops that must execute at a fixed frequency (e.g., 400 Hz sensor polling).
- Asynchronous tasks running in parallel at different frequencies within a single event loop.
- Simulation or game loops that need consistent frame rates or update frequencies.
- Data acquisition or sensor sampling at a regulated rate without blocking other operations.
- Real-time monitoring or telemetry collection at a specified sampling frequency.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides synchronous and asynchronous rate limiters to regulate loop execution frequency at a specified rate, similar to rospy.Rate.
Yes. The package is lightweight, dependency-free, actively maintained, permissively licensed, and solves a common need in control and real-time systems. Install it if you need straightforward loop frequency regulation in synchronous or asynchronous code.
Install
loop-rate-limiters on PyPI
pip
pip install loop-rate-limitersuv
uv add loop-rate-limiterspoetry
poetry add loop-rate-limitersInstalling loop-rate-limiters
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained with a recent release on 2025-08-13 and ongoing repository activity.
License in practice
Permissive license allows use in commercial and open-source projects without significant restrictions.
Quickstart
pip install loop-rate-limiters
from loop_rate_limiters import RateLimiter
rate = RateLimiter(frequency=400.0)
while True:
rate.sleep()
Verify before relying
- Whether the rate limiter maintains accuracy under high-frequency or variable-load conditions.
- How the implementation handles system clock adjustments or sleep precision on different operating systems.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 366 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 280,738/month — #8,107 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: loop_rate_limiters-1.2.0-py3-none-any.whl
Keywords: rate, loop, frequency, regulator, limiter
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
ratelimiterEnforces rate limiting on function calls and…
permissive · top 15,000 on PyPI
asynciolimiterProvides rate limiting for async Python code by…
permissive · top 5,000 on PyPI
ratelimRatelim enforces rate limits on function calls…
permissive · top 5,000 on PyPI
fastapi-limiterAdds request rate limiting to FastAPI routes…
permissive · top 5,000 on PyPI
aiolimiterImplements a rate limiter for asyncio using the…
permissive · top 5,000 on PyPI
rushrush provides rate-limiting algorithms…
permissive · top 15,000 on PyPI
requests-ratelimiterAdds rate-limiting to the requests library by…
permissive · top 5,000 on PyPI
throttlerProvides rate limiting, concurrency limiting,…
permissive · top 5,000 on PyPI
upstash-ratelimitProvides connectionless rate limiting for…
permissive · top 15,000 on PyPI
controlImplements core operations for analyzing and…
permissive · top 15,000 on PyPI