Metadata-Version: 2.1
Name: CachiPy
Version: 0.0.1
Summary: A caching library specially designed for FastAPI
Author: Ambar Rizvi
Author-email: <brannstrom9911@gmail.com>
Keywords: cache,caching,API response,API caching,FastAPI cache,FastAPI caching,fastapi cacher
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Description-Content-Type: text/markdown

# CachiPy: A Caching Library for FastAPI

CachiPy is a caching library specially designed for use with FastAPI. It allows you to easily cache API responses and improve the performance of your FastAPI applications.

![CachiPy Logo](https://example.com/cachipy_logo.png)

## Features

- Simple and efficient caching for FastAPI applications.
- Support for caching API responses and function results.
- Easy integration with FastAPI routes.
- Customizable cache size and eviction policies.
- Automatic cache clearing.

## Installation

You can install CachiPy using pip:

```bash
pip install CachiPy
```
## Usage
```python
from fastapi import FastAPI
from CachiPy import cacheit
import time

app = FastAPI()

@cacheit
def factorial(n):
    if n <= 1:
        return 1
    else:
        return n * factorial(n - 1)

# ... define FastAPI routes and route handlers ...

# Use @cacheit decorator to cache results within your route handlers.
```
Example usage:
```python
@app.get("/factorial/{n}")
def calculate_factorial(n: int):
    result = factorial(n)
    return {
        "result": result,
        "execution_time": end_time - start_time
    }
```

Screenshots
### Before Caching
<img src='screenshots\uncached_fibonacci_20.png'>
<img src='screenshots\uncached_fibonacci_20_second.png'>
<img src='screenshots\uncached_fibonacci_25.png'>

### After Caching
<img src='screenshots\cached_factorial_250_second.png'>
<img src='screenshots\cached_factorial_250.png'>
<img src='screenshots\cached_fibonacci_300.png'>
<img src='screenshots\cached_fibonacci_20.png'>

## License
This library is released under the MIT License. See LICENSE for details.

## Contributing
Contributions are welcome! Please read our Contribution Guidelines for more details.

## Support
If you encounter any issues or have questions, please open an issue on GitHub.

## Acknowledgments
Thank you to the FastAPI community for inspiration and support.
