A library for throttling algorithms
Project description
This library is intended to be a collection of algorithms that can be reused when throttling user interactions with a resource (e.g., an API).
This library is still a work in progress. See goals for what we’re striving for.
Installation
pip install rush
Goals
Below is the project’s list of goals broken down by category
Features
A basic periodic interval rate limiter - N accesses per period of time. An example would be the GitHub API that limits authenticated users to 5,000 requests per hour.
A leaky bucket rate limiter based off of the Generic Cell Ratelimiting Algorithm (a.k.a, GCRA).
A Redis storage backend for rate limit results so that users can have state persisted across machines and application restarts.
A Redis GCRA implementation, likely borrowed from Ruby’s redis-gcra gem.
Quality
100% test coverage
Code auto-formatted by Black (CI will check if formatting wasn’t run prior to push)
Commit messages following a uniform Kernel-like style
Flake8, pylint, mypy, and bandit linting
Complete type annotations
Complete documentation linted by doclint and strictly compiled by Sphinx
Design
Composable - ability to confidently use one algorithmic limiter with any properly written storage backend
Easy to understand - hopefully it will be easy to understand how the library works because of how composable it will be
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rush-2018.12.1.tar.gz
.
File metadata
- Download URL: rush-2018.12.1.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 402f3ea6d5e3f90d636c2403b84729be831bfc8d6973645ab5febeeeb9fcef41 |
|
MD5 | 19bf135baa85d6c439c20da05ecd1ec5 |
|
BLAKE2b-256 | e3512e9c67b1daa66a6ebee6325eb0cc6b1c136914e40ea563848722d6775c5e |
File details
Details for the file rush-2018.12.1-py3-none-any.whl
.
File metadata
- Download URL: rush-2018.12.1-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d0eaed37f58b009a49f835a410d6fd5121e1480705abcefe90b6871b9118e76 |
|
MD5 | 03387b5da158d70df43b518b3e2195f7 |
|
BLAKE2b-256 | 3d425628bd0f6f440d00e128baa6eb343e66fe7f03f92c9797a63b588f0286fe |