Metadata-Version: 2.4
Name: cachememo
Version: 0.1.0
Summary: TTL memoization for sync/async functions with stampede protection
Author: Fatemeh
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE 
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Dynamic: license-file

# cachememo

Tiny, safe memoization for Python - with TTL and async support.

`cachememo` helps you cache the results of expensive functions **without accidentally shooting yourself in the foot under concurrency**.

It’s designed for when:

- you need **time-based expiration (TTL)**
- you are working with **async functions**
- you want to avoid **cache stampedes** under load

---
### Installation

```bash
pip install cachememo
```

---

### Basic Usage
```py
from cachememo import memoize

@memoize(ttl=60)
def expensive(x: int) -> int:
    return x * 2

@memoize(ttl=30)
async def fetch_user(uid: str) -> dict:
    ...
```
---
## License

MIT
