passgen.utils
This file contains utils methods.
Module Contents
Functions
|
Return boolean value from environment variable. |
|
Return string value from environment variable. |
Attributes
- passgen.utils.BOOL_TRUE_STRINGS = ['true', 'on', 'ok', 'y', 'yes', '1']
- passgen.utils.get_bool_env(key: str, default: bool = False) bool
Return boolean value from environment variable.
- Parameters
key (str) – name of environment variable
default (bool) – default value if environment variable not exists or empty
- Returns
boolean value from environment variable
- Return type
bool
- passgen.utils.get_string_env(key: str, default: str = '') str
Return string value from environment variable.
- Parameters
key (str) – name of environment variable
default (str) – default value if environment variable not exists or empty
- Returns
string value from environment variable
- Return type
bool