environment
Utilities for loading environment variables from .env files.
load_dotenv(dotenv_path=None, *, override_existing=False)
Load environment variables from a .env file into the process environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dotenv_path
|
Path | str | None
|
Path to the .env file. Defaults to |
None
|
override_existing
|
bool
|
Whether to overwrite existing environment variables. |
False
|
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
A mapping of keys that were set from the .env file to their values. |
Raises:
| Type | Description |
|---|---|
OSError
|
If the .env file could not be read. |
Source code in src/refi_calculator/environment.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |