Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 5 hours 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-28T22:45:39.000Z (5 months ago)
- Last Synced: 2024-05-29T13:31:44.164Z (5 months 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: 827 KB
- Stars: 14
- Watchers: 2
- Forks: 6
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Cachetory
[![PyPI](https://img.shields.io/pypi/v/cachetory?logo=python&logoColor=yellow)](https://pypi.org/project/cachetory/)
[![Python versions](https://img.shields.io/pypi/pyversions/cachetory?logo=python&logoColor=yellow)](https://pypi.org/project/cachetory/)
[![Checks](https://img.shields.io/github/actions/workflow/status/kpn/cachetory/check.yml?label=checks&logo=github)](https://github.com/kpn/cachetory/actions/workflows/check.yml)
[![Coverage](https://codecov.io/gh/kpn/cachetory/branch/main/graph/badge.svg?token=UNYTTvxiWk)](https://codecov.io/gh/kpn/cachetory)
![Code style](https://img.shields.io/badge/code%20style-ruff-000000.svg)## 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
```