Skip to content

bagofstuff.cache

Provides a cache manager class.

CacheManager

CacheManager(
    base_path: Path | str,
    auto_create_directory: bool = True,
)

A cache manager class.

Parameters:

Name Type Description Default

base_path

Path | str

The base path for the cache.

required

auto_create_directory

bool

If True, automatically create the base path directory if it doesn't exist.

True

base_path property

base_path: Path

The base path for the cache.

get

get(**kwargs: Any) -> Path

Get a path from the cache.

Parameters:

Name Type Description Default

**kwargs

Any

The keyword arguments to use to get the path.

{}

Returns:

Type Description
Path

The path from the cache for the given input arguments.