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, redis_cache
from cache_alchemy.config import DefaultConfig
from redis import StrictRedis
config = DefaultConfig()
config.client = StrictRedis.from_url(config.CACHE_ALCHEMY_REDIS_URL, decode_responses=True)
@memory_cache
def add(i: complex, j: complex) -> complex:
return i + j
@redis_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.2.* (2019)
Support Partially Clear Cache with Arguments
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.2.1.tar.gz
(17.2 kB
view hashes)
Built Distribution
Close
Hashes for cache_alchemy-0.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16d41affa935f4b651fff84c17cc8cce1ba7244ffddec3d01b1eb17e886be05a |
|
MD5 | ae5465c679bac58cfd0ab6ea9ac30b60 |
|
BLAKE2b-256 | 321454137300f00be2767ab5dda02489d4e75f663063c762712f294e49444c39 |