Source code for citibike.utils.helpers

"""Helper utilities."""

from pathlib import Path

import yaml


[docs] def load_config(config_path: str = "config.yaml") -> dict: """Load configuration from YAML file. Args: config_path: Path to config file Returns: Configuration dictionary """ with open(config_path) as f: config = yaml.safe_load(f) return config
def get_project_root() -> Path: """Get the project root directory. Returns the root of the project (where config.yaml lives), navigating up from src/citibike/utils/. """ # Navigate up: utils -> citibike -> src -> project_root return Path(__file__).parent.parent.parent.parent