The Python Cache Toolkit.
Project description
Cache Alchemy
The Python Cache Toolkit.
Free software: MIT license
Documentation: https://cache-alchemy.readthedocs.io/en/latest/
Installation
$ pipenv install cache-alchemy
✨🍰✨
Only Python 3.6+ is supported.
Example
from cache_alchemy import memory_cache, json_cache
from cache_alchemy.config import DefaultConfig
from redis import Redis
config = DefaultConfig()
config.cache_redis_client = Redis.from_url(config.CACHE_ALCHEMY_REDIS_URL)
@memory_cache
def add(i: complex, j: complex) -> complex:
return i + j
@json_cache
def add(i: int, j: int) -> int:
return i + j
Features
Cache Json Serializable function return value with Distributed Redis Cache
Cache any function return value with Distributed Memory Cache
LRU Dict support - behave like normal dict
TODO
History
0.3.* (2020)
Refactory redis cache to json cache
Support pickle Cache
0.2.* (2019)
Support Partially Clear Cache with Arguments
Support Flush Backend Cache
Cache Redis Client Must Decode Responses
0.1.* (2019)
Support Method and Property Cache
Support cache as a decorator with no arguments.
Init Project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cache-alchemy-0.4.0.tar.gz
(19.8 kB
view hashes)
Built Distribution
Close
Hashes for cache_alchemy-0.4.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79bddbd4073fd202571a21352c45b8a74d4398253e5aef9ef2a5ca9001af0c02 |
|
MD5 | 9a58edcf3e52022d81927b49c45ceb84 |
|
BLAKE2b-256 | 6ebe848bed1635e15352d7cc2c2f0fe44a4d63a255d10db55f09120b939abfb9 |