MCPcopy Create free account
hub / github.com/theskumar/python-dotenv / set_as_environment_variables

Method set_as_environment_variables

src/dotenv/main.py:87–100  ·  view source on GitHub ↗

Load the current dotenv as system environment variable.

(self)

Source from the content-addressed store, hash-verified

85 yield mapping.key, mapping.value
86
87 def set_as_environment_variables(self) -> bool:
88 """
89 Load the current dotenv as system environment variable.
90 """
91 if not self.dict():
92 return False
93
94 for k, v in self.dict().items():
95 if k in os.environ and not self.override:
96 continue
97 if v is not None:
98 os.environ[k] = v
99
100 return True
101
102 def get(self, key: str) -> Optional[str]:
103 """

Callers 1

load_dotenvFunction · 0.95

Calls 1

dictMethod · 0.95

Tested by

no test coverage detected