betty.cache.file module

Provide caching that persists cache items to files.

class betty.cache.file.BinaryFileCache(localizer, cache_directory_path, *, scopes=None)[source]

Bases: _FileCache[bytes]

Provide a cache that persists bytes values to binary files.

Parameters:
localizer

cache_directory_path

scopes=None

cache_item_file_path(cache_item_id)[source]
Parameters:
cache_item_id

Return type:

pathlib.Path

property path : Path
class betty.cache.file.PickledFileCache(localizer, cache_directory_path, *, scopes=None)[source]

Bases: _FileCache[CacheItemValueContraT], Generic[CacheItemValueContraT]

Provide a cache that pickles values and persists them to files.

Parameters:
localizer

cache_directory_path

scopes=None