Skip to main content

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.

Status Tests Coverage Python Version Badges License

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 a redis.Redis instance.
  • MemCached does the same for a Memcached server. The utility class JsonSerde is a convenient JSON serializer-deserializer class for Memcached.
  • DictCache a dict cache.

Other wrappers to extend cache capabilities

  • PrefixedCache, PrefixedMemCached and PrefixedRedisCache add a prefix to distinguish sources on a shared cache.
  • StatsCache, StatsMemCached and StatsRedisCache add a hits() 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 using logging.

Cache utilities

  • cached decorator: a cachetools replacement which allows to test e if a function result is in cache, and to delete such an entry.
  • cacheFunctions and cacheMethods: 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


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.3.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

CacheToolsUtils-8.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file CacheToolsUtils-8.3.tar.gz.

File metadata

  • Download URL: CacheToolsUtils-8.3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for CacheToolsUtils-8.3.tar.gz
Algorithm Hash digest
SHA256 4218c86f82db6805bca545e952990524e16cc3b06b73091b15e4fc755dad0b08
MD5 d968cd8836cdc99106b5ec22810736ad
BLAKE2b-256 5a898fcdffe507097050870ad5f324e943bedfeaf88d7352a5acdf4e85f3a37d

See more details on using hashes here.

File details

Details for the file CacheToolsUtils-8.3-py3-none-any.whl.

File metadata

  • Download URL: CacheToolsUtils-8.3-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for CacheToolsUtils-8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 eec685e701a11fecdfa1983c9a5227080cc18e7d85574595698a45acb505dd80
MD5 c253eee7add5589541ac5b28344cf787
BLAKE2b-256 b620719fc1d837d72f6735a31c708154d052638aa74fe48088d169062e4abb8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page