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
Built Distribution
File details
Details for the file cache-alchemy-0.2.2.tar.gz
.
File metadata
- Download URL: cache-alchemy-0.2.2.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
d5cc9493074d1f2b5ad3b1dd9db9387107dbef27432d8324127058e1e9bc38b8
|
|
MD5 |
801aebee2deccc93713d9059f67d8c05
|
|
BLAKE2b-256 |
bdca2663de628fd14606f88ada1a7121bb4ae0ffed8a424b570c3b750803787f
|
File details
Details for the file cache_alchemy-0.2.2-py2.py3-none-any.whl
.
File metadata
- Download URL: cache_alchemy-0.2.2-py2.py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
c43b6e811f0575ac2b7508d2f92eef4050d57a057d73006999d1e9c45e978768
|
|
MD5 |
9802a989a66784f1f1b6398a2bb5f5ab
|
|
BLAKE2b-256 |
b6658ab483789f34780cff73c214d5fb00a2b3779e4585c5cd3c704d614e757c
|