Files
python-repositories/python_repositories/config/dotenv_loader.py
Brian Bjarke JensenandCursor 7991dabdbc Add config and client injection with test reorganization.
Introduce typed config objects, optional adapter injection, and .env loading to simplify testing while preserving env-based defaults for production usage.

Co-authored-by: Cursor <[email protected]>
2026-07-06 20:44:08 +02:00

15 lines
397 B
Python

"""Load environment variables from a .env file."""
from __future__ import annotations
from pathlib import Path
from dotenv import load_dotenv as _load_dotenv
def load_dotenv(path: str | Path | None = None) -> bool:
"""Load .env into os.environ. Idempotent; returns True if a file was loaded."""
if path is None:
return bool(_load_dotenv())
return bool(_load_dotenv(path))