- get_var_list(name, default=Ellipsis, cast=<class 'str'>, sep=';')¶
Retrieve a list of values from an environment variable, and raise if it’s undefined and no default was passed.
- Parameters:
name (
str) – The name of the environment variable.default (
list[TypeVar(T)] |Any) – The default value to return if the environment variable is not defined. If nothing is passed, undefined variables raise an exception.cast (
Callable[[str],TypeVar(T)]) – A function to cast values to a specific type. Default isstr.sep (
str|None) – The seperator to use between values. Default is;. PassNoneto avoid splitting.
- Raises:
RuntimeError – If the environment variable is not defined and no default was provided.
- Return type:
list[TypeVar(T)]- Returns:
The value of the environment variable cast to type by the specified function.