{"id":3266,"library":"rush","title":"Rush: Throttling Algorithms","description":"Rush is a Python library that provides a composable and extensible framework for implementing various rate limiting algorithms and storage backends. It includes a periodic interval rate limiter, a leaky bucket rate limiter (Generic Cell Ratelimiting Algorithm - GCRA), and supports Redis and in-memory dictionary storage. The library emphasizes type annotations and requires Python 3.6 or newer. The current version is 2021.4.0, released in April 2021.","status":"maintenance","version":"2021.4.0","language":"en","source_language":"en","source_url":"https://github.com/sigmavirus24/rush","tags":["throttling","rate-limiting","algorithms","redis","concurrency","api"],"install":[{"cmd":"pip install rush","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Required for using the Redis storage backend.","package":"redis","optional":true}],"imports":[{"symbol":"quota","correct":"from rush import quota"},{"symbol":"throttle","correct":"from rush import throttle"},{"symbol":"PeriodicLimiter","correct":"from rush.limiters import periodic"},{"symbol":"DictionaryStore","correct":"from rush.stores import dictionary"}],"quickstart":{"code":"from rush import quota\nfrom rush import throttle\nfrom rush.limiters import periodic\nfrom rush.stores import dictionary\n\nt = throttle.Throttle(\n    limiter=periodic.PeriodicLimiter(\n        store=dictionary.DictionaryStore()\n    ),\n    rate=quota.Quota.per_hour(\n        count=5000,\n        burst=500,\n    ),\n)\n\nlimit_result = t.check('expensive-operation/user@example.com', 1)\n\nprint(f\"Limited: {limit_result.limited}\")\nprint(f\"Remaining: {limit_result.remaining}\")\nprint(f\"Reset after: {limit_result.reset_after}\")","lang":"python","description":"This quickstart demonstrates how to set up a basic periodic rate limiter using an in-memory dictionary store, defining a quota of 5000 requests per hour with a burst of 500. It then checks if an operation is limited and prints the result, remaining allowance, and reset time."},"warnings":[{"fix":"Refer to the official documentation for the latest recommended API usage and be prepared for potential changes to higher-level abstractions in future updates.","message":"The library's API is explicitly described as 'preliminary' and 'experimental'. While current imports are promised not to break, 'porcelain' (higher-level abstractions) may be added in future versions, potentially altering the recommended usage patterns.","severity":"gotcha","affected_versions":"2021.4.0 and earlier"},{"fix":"Evaluate if the existing feature set meets your needs and be aware that new features or rapid bug fixes may not be a priority for the maintainers.","message":"The last release (2021.4.0) was in April 2021. While the project is marked as 'Production/Stable', development activity appears to be infrequent. Users seeking actively developed or frequently updated libraries might need to consider this pace.","severity":"gotcha","affected_versions":"2021.4.0 and later"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}