10 Commits

Author SHA1 Message Date
f3453cb0fc release: bump version to 0.3.0
- Refactor Redis backend connection handling and pool management
- Update algorithm implementations with improved type annotations
- Enhance config loader validation with stricter Pydantic schemas
- Improve decorator and middleware error handling
- Expand example scripts with better docstrings and usage patterns
- Add new 00_basic_usage.py example for quick start
- Reorganize examples directory structure
- Fix type annotation inconsistencies across core modules
- Update dependencies in pyproject.toml
2026-03-17 21:04:34 +00:00
492410614f refactor: improve config loader validation with Pydantic schemas
- Replace manual field type validation with Pydantic model schemas
- Add pydantic>=2.0 as core dependency
- Fix sync wrapper in decorator to properly handle rate limiting
- Update pyright settings for stricter type checking
- Fix repository URL in pyproject.toml
- Remove unused main.py
- Update test assertions for new validation error format
2026-03-07 15:43:25 +00:00
bb07ac816f fix: resolve flaky test and JSON config validation 2026-02-04 01:33:44 +00:00
34e07f6b7e style: apply ruff formatting 2026-02-04 01:28:45 +00:00
6bc108078f style: minor code style improvements in core modules 2026-02-04 01:07:53 +00:00
064af30d0f refactor: replace algorithm dict lookup with match/case pattern 2026-02-04 01:07:43 +00:00
3510ea564a refactor: use contextlib.suppress and sort __slots__ in backends 2026-02-04 01:07:32 +00:00
fb23e3c7cf feat: add configuration loader for .env and JSON files
- Add ConfigLoader class for loading RateLimitConfig and GlobalConfig
- Support .env files with FASTAPI_TRAFFIC_* prefixed variables
- Support JSON configuration files with type validation
- Add convenience functions: load_rate_limit_config, load_global_config
- Add load_rate_limit_config_from_env, load_global_config_from_env
- Support custom environment variable prefixes
- Add comprehensive error handling with ConfigurationError
- Add 47 tests for configuration loading
- Add example 11_config_loader.py with 9 usage patterns
- Update examples/README.md with config loader documentation
- Update CHANGELOG.md with new feature
- Fix typo in limiter.py (errant 'fi' on line 4)
2026-02-01 13:59:32 +00:00
9fe700296d Add get_stats to MemoryBackend and update pytest config
Added get_stats() method for consistency with RedisBackend. Also added
httpx and pytest-asyncio as dev dependencies.
2026-01-09 00:50:43 +00:00
da496746bb Initial commit: fastapi-traffic rate limiting library
- Core rate limiting with multiple algorithms (sliding window, token bucket, etc.)
- SQLite and memory backends
- Decorator and dependency injection patterns
- Middleware support
- Example usage files
2026-01-09 00:26:19 +00:00