ahvn.cache.json_cache module¶

JSON-file-based cache backend.

class ahvn.cache.json_cache.JsonCache(path, exclude=None, *args, **kwargs)[source]¶

Bases: BaseCache

An implementation of BaseCache that stores data in JSON files in a specified directory. Each item key:value is stored in a separate JSON file named after the key, with values serialized as JSON.

Parameters:
__init__(path, exclude=None, *args, **kwargs)[source]¶

Initialization.

Parameters:
  • path (str) – Path to the directory where JSON files will be stored.

  • exclude (Optional[Iterable[str]]) – Keys to exclude from inputs when creating cache entries.

  • *args – Additional positional arguments.

  • **kwargs – Additional keyword arguments.