Convert String to Boolean value :param given_str: given string :return: converted string in Boolean
(given_str: str)
| 5 | |
| 6 | |
| 7 | def convert_str_to_bool(given_str: str) -> bool: |
| 8 | """ |
| 9 | Convert String to Boolean value |
| 10 | |
| 11 | :param given_str: given string |
| 12 | :return: converted string in Boolean |
| 13 | """ |
| 14 | if given_str: |
| 15 | if type(given_str) is str: |
| 16 | return given_str.lower() in ("yes", "true", "t", "1") |
| 17 | else: |
| 18 | raise AttributeError |
| 19 | else: |
| 20 | logger.info(f"'{given_str}' is empty!") |
| 21 | return False |
| 22 | |
| 23 | |
| 24 | def get_env_value_or_raise(env_key: str) -> str: |
no outgoing calls