Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

aiolimiter

Azure Pipelines status for master branch codecov.io status for master branch Latest PyPI package version Latest Read The Docs

Introduction

An efficient implementation of a rate limiter for asyncio.

This project implements the Leaky bucket algorithm, giving you precise control over the rate a code section can be entered:

from aiolimiter import AsyncLimiter

# allow for 100 concurrent entries within a 30 second window
rate_limit = AsyncLimiter(100, 30)


async def some_coroutine():
    async with rate_limit:
        # this section is *at most* going to entered 100 times
        # in a 30 second period.
        await do_something()

It was first developed as an answer on Stack Overflow.

Documentation

https://aiolimiter.readthedocs.io

Installation

$ pip install aiolimiter

The library requires Python 3.6 or newer.

Requirements

  • Python >= 3.6

License

aiolimiter is offered under the MIT license.

Source code

The project is hosted on GitHub.

Please file an issue in the bug tracker if you have found a bug or have some suggestions to improve the library.

Developer setup

This project uses poetry to manage dependencies, testing and releases. Make sure you have installed that tool, then run the following command to get set up:

poetry install -E docs && poetry run doit devsetup

Apart from using poetry run doit devsetup, you can either use poetry shell to enter a shell environment with a virtualenv set up for you, or use poetry run ... to run commands within the virtualenv.

Tests are run with pytest and tox. Releases are made with poetry build and poetry publish. Code quality is maintained with flake8, black and mypy, and pre-commit runs quick checks to maintain the standards set.

A series of doit tasks are defined; run poetry run doit list (or doit list with poetry shell activated) to list them. The default action is to run a full linting, testing and building run. It is recommended you run this before creating a pull request.

Metadata

Release files for aiolimiter 1.0.0b0

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

Source distribution (sdist)

Source distribution for aiolimiter 1.0.0b0
File Size Uploaded Provenance Actions
aiolimiter-1.0.0b0.tar.gz 6.2 kB Without provenance Details for aiolimiter-1.0.0b0.tar.gz

Built distribution (wheel)

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

Total release size: 12.6 kB

Release files / aiolimiter-1.0.0b0.tar.gz

Download URL aiolimiter-1.0.0b0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e32c8ab19af2e137d2248146f6b1c2c776e515c116028134fab7934bf1ff2c4a
BLAKE2b-256 checksum
How to use checksums
78461c4ffa1fde1a0b3d928e5129d45a3c8c111ae879da0351db2da4e785f9d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.5

Release files / aiolimiter-1.0.0b0-py3-none-any.whl

Download URL aiolimiter-1.0.0b0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09a843b840041528234a42532917cc5e864953a0464543929cd348ecbbbe5074
BLAKE2b-256 checksum
How to use checksums
188d13cfb12f39be00bb2d5a87c892bf5b12938c92cf7ed6cdd6fba72660ab3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.5

Security for aiolimiter 1.0.0b0

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