Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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


Documentation

## Sneak peak

```python
from cachetory import serializers
from cachetory.backends import async_ as async_backends
from cachetory.caches.async_ import Cache

cache = 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
```