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)
@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.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.1.4.tar.gz
(15.6 kB
view hashes)
Built Distribution
Close
Hashes for cache_alchemy-0.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e176642e3fa71c1f44b6460431fa5680ea16fdb39bb51af7e4eb15b874cf9a3 |
|
MD5 | c7fd29dc40d3c37a3442b06f7c5e10bb |
|
BLAKE2b-256 | 0be6875a9d66984d1aedea9986d58a8a0430ee8d1db7c7153365a4a201710c91 |