Get a value from a dictionary or an environment variable.
get_from_dict_or_env(
data: dict[str, Any],
key: str | list[str],
env_key: str,
default: str | None = None
) -> str| Name | Type | Description |
|---|---|---|
data* | dict[str, Any] | The dictionary to look up the key in. |
key* | str | list[str] | The key to look up in the dictionary. This can be a list of keys to try in order. |
env_key* | str | The environment variable to look up if the key is not in the dictionary. |
default | str | None | Default: NoneThe default value to return if the key is not in the dictionary or the environment. |