Metadata-Version: 2.4
Name: fastapi-ratelimit-middleware
Version: 0.1.0
Summary: Rate limiting middleware for FastAPI applications
Home-page: https://github.com/zaibe_.x/fastapi-rate-limit
Author: Shahzaiby
Author-email: shahzaibshah0028@gmail.com
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.68.0
Requires-Dist: redis>=4.0.0
Requires-Dist: pydantic>=1.8.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.15.0; extra == "dev"
Requires-Dist: pytest-cov>=2.12.0; extra == "dev"
Requires-Dist: pytest-mock>=3.6.0; extra == "dev"
Requires-Dist: black>=21.5b2; extra == "dev"
Requires-Dist: isort>=5.9.0; extra == "dev"
Requires-Dist: mypy>=0.910; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# FastAPI Rate Limit

A flexible rate limiting middleware for FastAPI applications.

## Features

- Simple and intuitive API
- Multiple storage backends (in-memory, Redis)
- Customizable rate limit rules
- Response headers with rate limit information
- Exception handling with customizable responses

## Installation

```bash
pip install fastapi-rate-limit
```

## Quick Start

```python
from fastapi import FastAPI
from fastapi_rate_limit import RateLimitMiddleware, Rule

app = FastAPI()

# Add rate limiting middleware
app.add_middleware(
    RateLimitMiddleware,
    rules=[
        Rule(path="/api/*", limit=10, period=60),  # 10 requests per minute for /api/* paths
    ]
)

@app.get("/")
async def root():
    return {"message": "Hello World"}

@app.get("/api/items")
async def get_items():
    return {"items": ["item1", "item2"]}
```

## Documentation

For more detailed documentation, please visit [our documentation](https://github.com/zaibe_.x/fastapi-rate-limit).

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the LICENSE file for details.
