All Projects → mjpieters → aiolimiter

mjpieters / aiolimiter

Licence: MIT License
An efficient implementation of a rate limiter for asyncio.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to aiolimiter

gentle-force
Brute-force, error and request rate limiting
Stars: ✭ 45 (-62.81%)
Mutual labels:  rate-limiting, leaky-bucket
flaps
🛬 Modular rate limiting for PHP.
Stars: ✭ 64 (-47.11%)
Mutual labels:  rate-limiting, leaky-bucket
FireflySoft.RateLimit
It is a rate limiting library based on .Net standard.
Stars: ✭ 76 (-37.19%)
Mutual labels:  rate-limiting, leaky-bucket
aiorwlock
Read/Write Lock - synchronization primitive for asyncio
Stars: ✭ 90 (-25.62%)
Mutual labels:  asyncio
py17track
📦 A simple API to track package info from 17track.com
Stars: ✭ 20 (-83.47%)
Mutual labels:  asyncio
deeppyer
Image deepfryer written in Python.
Stars: ✭ 36 (-70.25%)
Mutual labels:  asyncio
automate-home
Yet another python home automation (iot) project. Because a smart light is more than just on or off.
Stars: ✭ 59 (-51.24%)
Mutual labels:  asyncio
phi
an api-gateway based on openresty
Stars: ✭ 23 (-80.99%)
Mutual labels:  rate-limiting
sanic-url-shortener
Example of how to use Sanic and asyncpg (PostgreSQL)
Stars: ✭ 16 (-86.78%)
Mutual labels:  asyncio
pomp
Screen scraping and web crawling framework
Stars: ✭ 61 (-49.59%)
Mutual labels:  asyncio
dvhb-hybrid
A package to mix django and asyncio in one application
Stars: ✭ 45 (-62.81%)
Mutual labels:  asyncio
aioprometheus
A Prometheus Python client library for asyncio-based applications
Stars: ✭ 114 (-5.79%)
Mutual labels:  asyncio
throttle
Throttling Middleware for Martini
Stars: ✭ 63 (-47.93%)
Mutual labels:  rate-limiting
nardis
A small web framework based on ASGI
Stars: ✭ 14 (-88.43%)
Mutual labels:  asyncio
aiodogstatsd
An asyncio-based client for sending metrics to StatsD with support of DogStatsD extension
Stars: ✭ 26 (-78.51%)
Mutual labels:  asyncio
asyncqlio
A fully async ORM for Python 3.5+
Stars: ✭ 25 (-79.34%)
Mutual labels:  asyncio
waio
Is a pretty simple and fully asynchronous framework for WhatsApp Business API written in Python 3.7 with asyncio and aiohttp.
Stars: ✭ 18 (-85.12%)
Mutual labels:  asyncio
i2plib
🐍 i2plib: A modern asynchronous library for building I2P applications
Stars: ✭ 23 (-80.99%)
Mutual labels:  asyncio
python-insteonplm
Python 3 asyncio module for interfacing with Insteon Powerline modems
Stars: ✭ 34 (-71.9%)
Mutual labels:  asyncio
leaky-bucket
A tokio-based leaky bucket rate limiter
Stars: ✭ 32 (-73.55%)
Mutual labels:  leaky-bucket

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.7 or newer.

Requirements

  • Python >= 3.7

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].