# This file serves as a singleton for the configuration settings of the project import tomllib import os import pathlib as pl from typing import Any def get_config() -> dict[str, Any]: """ Load the configuration file and return the settings as a dictionary. """ match os.getenv("ANN_CONFIG_PATH"): case None: config_path = pl.Path(__file__).parent.parent / "config.toml" case str(path): config_path = pl.Path(path) if not config_path.exists(): config_path = pl.Path(__file__).parent.parent / "config.toml" with open(config_path, "rb") as f: config = tomllib.load(f) return config config = get_config()