apeye.cache¶
Caching functions for functions.
See also
- class Cache(app_name)[source]¶
Bases:
objectCache function arguments to and in-memory dictionary and a JSON file.
- Parameters
app_name (
str) – The name of the app. This dictates the name of the cache directory.
Methods:
__call__(func)Decorator to cache the return values of a function based on its inputs.
clear([func])Clear the cache.
load_cache(func)Loads the cache for the given function.
Attributes:
The name of the app.
The location of the cache directory on disk.
Mapping of function names to their caches.
- __call__(func)[source]¶
Decorator to cache the return values of a function based on its inputs.
- Parameters
func (
Callable)