Skip to content

paths

triplum.utils.paths

Where triplum keeps re-creatable files on this machine.

cache_home

cache_home() -> Path

$XDG_CACHE_HOME/triplum, or ~/.cache/triplum when unset or relative; not created.

Source code in src/triplum/utils/paths.py
 7
 8
 9
10
11
12
def cache_home() -> Path:
    """`$XDG_CACHE_HOME/triplum`, or `~/.cache/triplum` when unset or relative; not created."""
    root = Path(os.environ.get("XDG_CACHE_HOME") or Path.home() / ".cache")
    if not root.is_absolute():
        root = Path.home() / ".cache"
    return root / "triplum"