MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / load_env_file

Function load_env_file

methods/MIRIX/scripts/reset_database.py:17–28  ·  view source on GitHub ↗

Load environment variables from .env file if it exists.

()

Source from the content-addressed store, hash-verified

15
16# Load environment variables from .env file
17def load_env_file():
18 """Load environment variables from .env file if it exists."""
19 env_file = Path(__file__).parent.parent / ".env"
20 if env_file.exists():
21 with open(env_file, "r") as f:
22 for line in f:
23 line = line.strip()
24 if line and not line.startswith("#") and "=" in line:
25 key, value = line.split("=", 1)
26 # Don't override existing environment variables
27 if key not in os.environ:
28 os.environ[key] = value
29
30
31# Load .env file at module import

Callers 1

reset_database.pyFile · 0.85

Calls 1

existsMethod · 0.45

Tested by

no test coverage detected