Metadata-Version: 2.1
Name: rate-guardian
Version: 0.1.0
Summary: Distributed Redis rate limiter for Python APIs using sliding window algorithm
Author: JPEG
Project-URL: Homepage, https://github.com/Jpeg-create/rate-guard
Project-URL: Repository, https://github.com/Jpeg-create/rate-guard
Project-URL: Issues, https://github.com/Jpeg-create/rate-guard/issues
Keywords: rate-limit,fastapi,redis,api,distributed,sliding-window
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: upstash-redis
Requires-Dist: fastapi

# RateGuard

RateGuard is a distributed rate limiting library for Python APIs using Redis.

## Features

- Sliding Window Rate Limiting
- Redis Sorted Sets
- FastAPI Middleware
- Distributed API protection
- Works across multiple servers

## How it works

RateGuard uses a **Sliding Window Rate Limiting algorithm** with Redis Sorted Sets.

1. Each request is stored with a timestamp
2. Old requests outside the window are removed
3. Remaining requests are counted
4. If the count exceeds the limit, the request is rejected

This design works across multiple API servers because Redis is shared.

Client → FastAPI → RateGuard → Redis → Decision

## Run Example

```bash
uvicorn examples.fastapi_example:app --reload



## Installation

```bash
pip install -r requirements.txt
