akvo.cache package

akvo.cache.cache_with_key(keyfunc: Callable[[...], Any], timeout: int = 300, cache_name: str = 'default', prepo_pickle: Type[PrePoPickler] | None = None)[source]

Decorator which applies Django caching to a function.

Parameters:
  • keyfunc – Function which computes a cache key from the original function’s arguments. You are responsible for avoiding collisions with other uses of this decorator or other uses of caching.

  • timeout – How long the value will be valid in the cache

  • cache_name – Which cache to store the value in

  • prepo_pickle – Pre- and post-processing class for pickled values

akvo.cache.delete_cache_data(key, cache_name='default')[source]
akvo.cache.list_cache_keys(cache_name: str = 'default') List[str][source]

List the keys that exist in the given cache

Not all cache clients support listing their keys, so this method can throw an exception

Submodules