Skip to content

Package Contents

__version__ = '2.0.0' module-attribute

get_cache_root

Create and return the path to the cache for Simyan, supports XDG_CACHE_HOME env.

RETURNS DESCRIPTION
Path

The path to the Simyan cache folder.

Source code in simyan/__init__.py
Python
 9
10
11
12
13
14
15
16
17
18
def get_cache_root() -> Path:
    """Create and return the path to the cache for Simyan, supports XDG_CACHE_HOME env.

    Returns:
        The path to the Simyan cache folder.
    """
    cache_home = os.getenv("XDG_CACHE_HOME", default=str(Path.home() / ".cache"))
    folder = Path(cache_home).resolve() / __project__
    folder.mkdir(parents=True, exist_ok=True)
    return folder