https://github.com/kpn/cachetory
Caching library with support for multiple cache backends
https://github.com/kpn/cachetory
async-cache asynchronous cache cache-decorators caching django-cache dummy-cache memory-cache pypi-package python-library python-package redis-cache synchronous
Last synced: 6 days ago
JSON representation
Caching library with support for multiple cache backends
- Host: GitHub
- URL: https://github.com/kpn/cachetory
- Owner: kpn
- License: apache-2.0
- Created: 2022-06-08T08:51:45.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-06-11T23:08:45.000Z (10 days ago)
- Last Synced: 2025-06-12T00:23:26.511Z (10 days ago)
- Topics: async-cache, asynchronous, cache, cache-decorators, caching, django-cache, dummy-cache, memory-cache, pypi-package, python-library, python-package, redis-cache, synchronous
- Language: Python
- Homepage: https://kpn.github.io/cachetory/
- Size: 688 KB
- Stars: 16
- Watchers: 3
- Forks: 6
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Cachetory
[](https://pypi.org/project/cachetory/)
[](https://pypi.org/project/cachetory/)
[](https://github.com/kpn/cachetory/actions/workflows/check.yml)
[](https://codecov.io/gh/kpn/cachetory)
## Documentation
## Sneak peak
```python
from cachetory import serializers
from cachetory.backends import async_ as async_backends
from cachetory.caches.async_ import Cachecache = Cache[int, bytes](
serializer=serializers.from_url("pickle://?pickle-protocol=4"),
backend=async_backends.from_url("redis://localhost:6379"),
)async def main() -> None:
await cache.set("foo", 42)
assert await cache.get("foo") == 42
```