ahvn.cache.disk_cache module¶

Disk-based cache powered by the ‘diskcache’ library.

class ahvn.cache.disk_cache.DiskCache(path, size_limit=int(32e9), exclude=None, *args, **kwargs)[source]¶

Bases: BaseCache

An implementation of BaseCache that stores data on disk using diskcache.

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

Initialization.

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

  • size_limit (int) – Maximum size of the cache in bytes. Defaults to 32e9 (32 GB).

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

  • *args – Additional positional arguments.

  • **kwargs – Additional keyword arguments.

close()[source]¶

Closes the cache.

Return type:

None