Spaces:
Running
Running
| 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 |