Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rush-2018.12.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

rush-2018.12.0-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file rush-2018.12.0.tar.gz.

File metadata

  • Download URL: rush-2018.12.0.tar.gz
  • Upload date:
  • Size: 10.9 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

Hashes for rush-2018.12.0.tar.gz
Algorithm Hash digest
SHA256 92cf1337e81d1e99afd7cbd49892fcf3a57d6f1e179a239b4b094e4d762d2655
MD5 57795decfa78322041c0927a013ff9a6
BLAKE2b-256 1bb8d606c742f7f8d38829866a06993041740cc4d8a0ae21b8a1bb035b8e505b

See more details on using hashes here.

File details

Details for the file rush-2018.12.0-py3-none-any.whl.

File metadata

  • Download URL: rush-2018.12.0-py3-none-any.whl
  • Upload date:
  • Size: 15.1 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

Hashes for rush-2018.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca7cd04a562e7798b807c83bf7553e61ace73bb172483b7b000e1edda1d47d8b
MD5 659ea980cf4d6765a33880947751ac8a
BLAKE2b-256 0484cc86c4afab4bf8fb70b3811087faa3f18bbc616de5b747db56108022b0c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page