Skip to main content

aiorate

Build Coverage Documentation PyPI version

Loop frequency regulator for asyncio with an API similar to rospy.Rate.

This project is archived as it has been superseded by loop-rate-limiters.

Installation

pip install aiorate

Usage

The Rate class provides a non-blocking loop frequency limiter:

  • Set the loop frequency in Hz at construction: rate = aiorate.Rate(200.0)
  • Call await rate.sleep() at every loop cycle

Here is what it looks like in practice:

import asyncio
import aiorate

async def main():
    rate = aiorate.Rate(400.0)  # Hz
    while True:
        loop_time = asyncio.get_event_loop().time()
        print(f"Hello from loop at {loop_time:.3f} s")
        await rate.sleep()

if __name__ == "__main__":
    asyncio.run(main())

Check out the examples folder for more advance use cases, such as multiple loops running simultaneously at different rates.

Metadata

Release files for aiorate 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiorate 1.0.2
File Size Uploaded Provenance Actions
aiorate-1.0.2.tar.gz 14.8 kB Without provenance Details for aiorate-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aiorate 1.0.2
File Interpreter ABI Platform Actions
aiorate-1.0.2-py3-none-any.whl Python 3 none any Details for aiorate-1.0.2-py3-none-any.whl

Total release size: 23.6 kB

Release files / aiorate-1.0.2.tar.gz

Download URL aiorate-1.0.2.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5d3f2d4f84de533ebfb902a4f4d3c3057f455ccbd2b261a76cb8f653105aa1eb
BLAKE2b-256 checksum
How to use checksums
d2c1317c3d4c2d2f8ade5ee731e4ee1b6df1444ebffe0d19a83cc4912187248c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.22.0

Release files / aiorate-1.0.2-py3-none-any.whl

Download URL aiorate-1.0.2-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6fdf4e90463f1ce5441709fc50129d84f314ce1a788acafaa79d0ee0cd4af38
BLAKE2b-256 checksum
How to use checksums
ddd4dc52c148fd12f95d14a0edf32fad83123bed1dac99bfaf61aad7a0df2921
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.22.0

Security for aiorate 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page