Changelog¶
All notable changes to smartratelimit. The format follows Keep a Changelog, and the project uses Semantic Versioning.
Current release: v0.3.2
0.3.2¶
Fixed¶
AsyncRateLimiterwas not rate limiting at all in most real deployments. Header lookups were case-sensitive, but httpx lowercases header names and HTTP/2 requires lowercase on the wire — so limits went undetected against GitHub, Stripe, OpenAI and anything behind a modern proxy, and async requests went out unpaced. Lookups are now case-insensitive, matching the sync limiter.arequest_aiohttpreturned a rawClientResponseafter retrying a 429 instead of the usual wrapper, soresponse.status_coderaisedAttributeErroron the retry path only.
Added¶
- Regression tests for lowercase headers, real
httpx.Headersobjects, and the aiohttp 429 retry return type - This documentation site
- PyPI publishing via GitHub Actions trusted publishing
0.3.1¶
Changed¶
- Licence changed from MIT to Apache 2.0
- Documentation links corrected for PyPI rendering
0.3.0¶
Added¶
AsyncRateLimiterfor async/await workloads- httpx integration via
arequest_httpx() - aiohttp integration via
arequest_aiohttp() - Advanced retry logic:
RetryHandler,RetryConfig,RetryStrategy - Retry strategies: exponential, linear, fixed, none
MetricsCollectorfor per-endpoint request and quota tracking- Prometheus and JSON metrics export
smartratelimitCLI withstatus,clear,probe,list- Examples covering async, retry, and metrics
Changed¶
- Package exports extended with the async, retry, and metrics classes
- Improved error handling in async operations
Fixed¶
- Better async context management
- More reliable response handling for aiohttp
0.2.0¶
Added¶
- SQLite storage backend for persistent rate limit state
- Redis storage backend for distributed and multi-process applications
- Shared state across processes via Redis
- Performance benchmarks and testing utilities
- Tests for the SQLite and Redis backends
- Graceful fallback to memory storage when a backend fails
Changed¶
- Storage backend initialisation with clearer error handling
Fixed¶
- Thread safety in the storage backends
- Handling of storage backend failures
0.1.0¶
Added¶
RateLimiterwith automatic rate limit detection- Token bucket pacing
- Header detection for GitHub, Stripe, Twitter, OpenAI, and standard
X-RateLimit-*APIs Retry-Afterhandling on 429 responses- In-memory storage backend
requestsintegration and session wrapping- Rate limit status monitoring
- Manual limit configuration and custom header mapping
raise_on_limitmode- Thread-safe operation