skillfed

loop-rate-limiters

Loop rate limiters.

loop-rate-limiters v1.2.0 280.7K downloads/30d#8,107 on PyPI35
Permissive license Active released

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

uv

uv add loop-rate-limiters

poetry

poetry add loop-rate-limiters

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Mathematics

Tags

loop rate limiterfrequency regulatorasync rate limitercontrol loop speedsleep-based frequency controlrospy rate alternativeasyncio rate limiting
timing-controlroboticsasyncio

More Mathematics packages