Skip to main content

Provides asyncio storage and strategy implementations for the limits library.

Project description

alimits

GitHub Workflow Status GitHub Buy a tree

Provides asyncio-compatible implementations of the limits library storage and strategy options. Used in the slowapi library.

Documentation is available here.

Available on PyPi at alimits.

Strategies

This library implements a couple asyncio limiting strategies:

  • Fixed window → (alimits.strategies.AsyncFixedWindowRateLimiter)
  • Moving window → (alimits.strategies.AsyncMovingWindowRateLimiter)
  • Fixed window with elastic expiration → (alimits.strategies.AsyncFixedWindowElasticRateLimiter)

Resources

  1. https://limits.readthedocs.io/en/stable/strategies.html
  2. https://medium.com/figma-design/an-alternative-approach-to-rate-limiting-f8a06cf7c94c
  3. https://cloud.google.com/architecture/rate-limiting-strategies-techniques

Storage Backends

Each of the above rate limiters support a couple different storage backends:

  • Memory (in-memory, volatile) → (alimits.storage.AsyncMemoryStorage)
  • Redis (on-disk or in-memory, persistent) → (alimits.storage.AsyncRedisStorage)

Other storage backends are a WIP.

License

Copyright (c) 2021 Elias Gabriel, 2020 Laurent Savaete, 2015 Ali-Akber Saifee

This software is licensed under the MIT License.


This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the forest you’ll be creating employment for local families and restoring wildlife habitats.

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

alimits-1.0.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

alimits-1.0.0-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

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