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.
Other wrappers to extend cache capabilities
PrefixedCache
,PrefixedMemCached
andPrefixedRedisCache
add a prefix to distinguish sources on a shared cache.StatsCache
,StatsMemCached
andStatsRedisCache
add ahits()
method to report the cache hit rate.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.
More
See the documentation, sources and issues on GitHub.
See packages on PyPI.
License
This code is public domain.
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
CacheToolsUtils-8.5.tar.gz
(8.5 kB
view hashes)
Built Distribution
Close
Hashes for CacheToolsUtils-8.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7abc88a23005a42b93f9dfb8399978925a57ab9b8b4806d41ceba417e734f603 |
|
MD5 | 1e6125b94bed4300045022f1343a48c9 |
|
BLAKE2b-256 | 0df3b271aeb0f404f93bd8da3823719cbfcfd5eee7e5d38ef1f7672cae00aa82 |