Spaces:
Running
Running
File size: 584 Bytes
f96eb1f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
from __future__ import annotations
from pathlib import Path
__all__ = ["get_project_root", "get_data_dir", "data_file"]
def get_project_root() -> Path:
"""Return the absolute path to the repository root (directory containing this file)."""
return Path(__file__).resolve().parent
def get_data_dir() -> Path:
"""Return the absolute path to the data directory under the repository root."""
return get_project_root() / "data"
def data_file(name: str) -> Path:
"""Return the absolute path to a file inside the data directory."""
return get_data_dir() / name |