{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/8"}],"enrichment":{"capability":"Token throttler implements rate limiting using a token bucket algorithm, supporting both synchronous and asynchronous code with pluggable storage backends and decorator-based or manual usage patterns.","skillfed_tags":["rate-limiting","token-bucket","async-support"],"use_cases":["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"],"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.\n\nThe 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.","worth_installing":"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."},"id":"token-throttler","links":{"html":"https://skillfed.io/packages/token-throttler","md":"https://skillfed.io/packages/token-throttler.md","pypi":"https://pypi.org/project/token-throttler/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-04-06","license_spdx":null,"license_treatment":"permissive","name":"token-throttler","python_support":"supports_current","summary":"Token throttler is an extendable rate-limiting library somewhat based on a token bucket algorithm"},"popularity":{"monthly_downloads":148692,"position":11021,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.5.1"}
