ahvn.cache.json_cache module

JSON-file-based cache backend.

class ahvn.cache.json_cache.JsonCache(path, exclude=None, *args, **kwargs)[源代码]

基类: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.

参数:
__init__(path, exclude=None, *args, **kwargs)[源代码]

Initialization.

参数:
  • 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.