Cachetools Utilities
Project description
CacheToolsUtils
Classes to add key prefix and stats to cachetools classes and use redis and memcached as storage backends, and other cache-related utils.
Module Contents
For our purpose, a cache is a key-value store, aka a dictionary, possibly with
some constraints on keys (type, size) and values (size, serialization).
This module provides new caches, wrappers and other utilities suitable to use
with cachetools
.
Cache classes
RedisCache
allows to see a Redis server as a python cache by wrapping aredis.Redis
instance.MemCached
does the same for a Memcached server. The utility classJsonSerde
is a convenient JSON serializer-deserializer class for Memcached.DictCache
a very simpledict
cache.
Wrappers to extend cache capabilities
PrefixedCache
,PrefixedMemCached
andPrefixedRedisCache
add a prefix to distinguish sources on a shared cache.StatsCache
,MemCached
andRedisCache
add ahits
method to report the cache hit rate,stats
to report statistics andreset
to reset statistics.LockedCache
use a (thread) lock to control cache accesses.TwoLevelCache
allows to combine two caches.DebugCache
to trace cache calls usinglogging
.
Cache utilities
cached
decorator: a cachetools replacement which allows to test if a function result is in cache, and to delete such an entry.cacheFunctions
andcacheMethods
: add caching to functions or methods.
License
This code is Public Domain.
All software has bug, this is software, hence… Beware that you may lose your hairs or your friends because of it. If you like it, feel free to send a postcard to the author.
More
See the documentation, sources and issues on GitHub.
See packages on PyPI.
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 cachetoolsutils-9.0.tar.gz
.
File metadata
- Download URL: cachetoolsutils-9.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffe9e858768b0e5f16dda7ae73e9e1545f4e01690400ff35fef6f959d8fd2a62 |
|
MD5 | e50dff119545261ad5966defbeeead9b |
|
BLAKE2b-256 | 7aa4b415cdf0406369b740dd9579cb77b1fa0e449c9de0f10a93bef48a9251d4 |
File details
Details for the file CacheToolsUtils-9.0-py3-none-any.whl
.
File metadata
- Download URL: CacheToolsUtils-9.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5597efb25eccc28dcfba69d69c632b9222b6b024612d509f4eff188ed211f3f9 |
|
MD5 | e3a90c84e8b5d721c042258fe0a253b1 |
|
BLAKE2b-256 | a687e8576f5867c64204cf3e089a0a1f5ced8565b2f5b853566934804f8e03c8 |