Load environment variable as string :param name: name of the environment variable :param required: whether the environment variable is required
(name: str, required: bool = False)
| 17 | |
| 18 | |
| 19 | def load_str_env(name: str, required: bool = False) -> str: |
| 20 | """ |
| 21 | Load environment variable as string |
| 22 | :param name: name of the environment variable |
| 23 | :param required: whether the environment variable is required |
| 24 | """ |
| 25 | if os.environ.get(name): |
| 26 | return os.environ.get(name) |
| 27 | |
| 28 | if default_env_values.get(name) is not None: |
| 29 | return default_env_values.get(name) |
| 30 | |
| 31 | if required: |
| 32 | raise Exception(f"Env {name} is not set") |
| 33 | |
| 34 | |
| 35 | def load_int_env(name: str, required: bool = False) -> int: |
no test coverage detected