token-throttler
Token throttler is an extendable rate-limiting library somewhat based on a token bucket algorithm
Decision gist · record as of 2026-08-14
Yes, if you need straightforward token-bucket rate limiting and can accept the project's dormant maintenance status. The library is simple to integrate, has no runtime dependencies, and works with modern Python versions. However, if you require active maintenance, frequent updates, or are building mission-critical systems, consider whether the 860-day gap since the last release poses a risk for your use case.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with no runtime dependencies.
- Marked dormant (860 days since last release), though classifiers indicate Production/Stable status and support for Python 3.8 through 3.12.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
last release 2024-04-06 (860 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 148,692 downloads/mo, #11,021 on PyPI
Alternatives
Verify before relying
from token_throttler import TokenThrottler, TokenBucket
from token_throttler.storage import RuntimeStorage
throttler = TokenThrottler(1, RuntimeStorage())
throttler.add_bucket("endpoint", TokenBucket(10, 10))
if throttler.consume("endpoint"):
print("Request allowed")
else:
print(f"Retry in {throttler.wait_time('endpoint')} seconds")- Whether dormant status (no recent commits visible) affects reliability for new deployments or bug fixes
- Performance characteristics under high concurrency or with large numbers of buckets
- Whether Redis storage extra is actively maintained given the project's maintenance status
What it is and what it does
Token throttler is a rate-limiting library that enforces request quotas using a token bucket algorithm. It allows you to define buckets with a maximum token count and replenishment time, then consume tokens before allowing actions to proceed. The library supports both blocking (synchronous) and non-blocking (asynchronous) modes, and can be used either manually by calling consume() or via decorators applied to functions and FastAPI routes.
The package is designed to be extensible: it ships with in-memory (RuntimeStorage) and Redis storage backends, and you can implement custom storage by extending the base storage classes. Configuration can be set globally or per-instance, with options to enable thread locking for race-condition safety and fail-safe behavior for missing identifiers. It officially supports Python 3.8 and later.
Use it for
- Protect API endpoints from abuse by limiting requests per user or IP address using FastAPI middleware
- Rate-limit background job processing by throttling function calls across multiple workers with Redis storage
- Enforce quota limits on internal service calls to prevent cascading failures or resource exhaustion
- Implement sliding-window rate limits on database queries or external API calls within a single application
- Decorate expensive functions to prevent them from being called more than N times per time window
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need straightforward token-bucket rate limiting and can accept the project's dormant maintenance status.
The library is simple to integrate, has no runtime dependencies, and works with modern Python versions. However, if you require active maintenance, frequent updates, or are building mission-critical systems, consider whether the 860-day gap since the last release poses a risk for your use case.
Install
token-throttler on PyPI
Before you install
Low install friction with no runtime dependencies. Marked dormant (860 days since last release), though classifiers indicate Production/Stable status and support for Python 3.8 through 3.12.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
from token_throttler import TokenThrottler, TokenBucket
from token_throttler.storage import RuntimeStorage
throttler = TokenThrottler(1, RuntimeStorage())
throttler.add_bucket("endpoint", TokenBucket(10, 10))
if throttler.consume("endpoint"):
print("Request allowed")
else:
print(f"Retry in {throttler.wait_time('endpoint')} seconds")
Verify before relying
- Whether dormant status (no recent commits visible) affects reliability for new deployments or bug fixes
- Performance characteristics under high concurrency or with large numbers of buckets
- Whether Redis storage extra is actively maintained given the project's maintenance status
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0,>=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 860 days since the last release |
| First released | |
| Downloads | 148,692 / month, #11,021 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries |
Evidence: token_throttler-1.5.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “fastapi throttling”
- token-throttlerToken throttler implements rate limiting using a token bucket…
- fastapi-limiterAdds request rate limiting to FastAPI routes using configurable…
- slowapiAdds rate limiting to Starlette and FastAPI endpoints using…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also throttled-py · throttler · rush · asyncio-throttle · asynciolimiter · fastapi-limiter · ratelimiter · pyrate-limiter · slowapi