Metadata-Version: 2.4
Name: flask_rlmt
Version: 0.1.0rc1
Summary: A rate limiter for flask
Project-URL: Homepage, https://github.com/anb2473/API_rate_limiter
Author-email: Austin Blass <austinblass@icloud.com>
License: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Dist: flask>=2.0.0
Description-Content-Type: text/markdown

# Flask RLMT (Flask Rate Limiter)

## About
This project is a rate limiter for Flask, and allows you to apply rate limit rules to routes, blueprints, or apply global limits that affect all routes.

## Current Stratagies
* Sliding window

## Installation
This project is registered with PyPi, and can be installed with
```bash
pip install flask_rlmt
```

## How to use
1. Import flask_rlmt
```python
import flask_rlmt
```
2. Create a new limiter
```python
app = Flask(__name__)

limiter = Limiter(
    app=app,
    rules=[
        "10 per minute",
        "100 per hour"
    ]
)
```
3. Add rules to an individual route
```python
@app.route("/")
@limiter.guard(rules=["1000/d"])
def home():
```
4. Apply rules to an entire blueprint
```python
auth_bp = Blueprint('auth', __name__, url_prefix='/auth')

limiter.apply(auth_bp, rules=["2 per 10s"])

app.register_blueprint(auth_bp)
```

## Detailed Instructions
For further questions on how to interact with the API, please refer to the [docs/QUICKSTART.md](docs/QUICKSTART.md).
