Metadata-Version: 2.1
Name: redis-rate-limiter
Version: 0.2.0
Summary: A Redis based rate limiter implementation for Python
Home-page: https://github.com/duyixian1234/redis-rate-limiter
License: MIT
Author: duyixian
Author-email: duyixian1234@qq.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Dist: redis (>=1)
Project-URL: Repository, https://github.com/duyixian1234/redis-rate-limiter
Description-Content-Type: text/markdown

# redis-rate-limiter

[![CI](https://github.com/duyixian1234/redis-rate-limiter/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/duyixian1234/redis-rate-limiter/actions/workflows/CI.yml)

## Install

```bash
pip install -U redis-rate-limiter
```

## Use

```python
from redis_rate_limiter.config import basic_config
from redis_rate_limiter.rate_limiter import RateLimiter

basic_config(redis_url='redis://localhost:6379/0')

@RateLimiter(10, period=1)
def greet():
    print('Hello')

for _ in range(100):
    greet()

# Raise RateLimitExceeded after print('Hello') 10 times
```

