get_config
- get_config(module, key, *, passthrough=None, default=None, dtype=None, raise_on_missing=False)[source]
Get a configuration value.
- Parameters:
module (
str
) – Name of the module (e.g.,pybel
) to get configuration forkey (
str
) – Name of the key (e.g.,connection
)passthrough (
Optional
[TypeVar
(X
)]) – If this is not none, will get returneddefault (
Optional
[TypeVar
(X
)]) – If the environment and configuration files don’t contain anything, this is returned.dtype (
Optional
[Type
[TypeVar
(X
)]]) – The datatype to parse out. Can either beint()
,float()
,bool()
, orstr()
. If none, defaults tostr()
.raise_on_missing (
bool
) – If true, will raise a value error if no data is found and no default is given
- Returns:
The config value or the default.
- Raises:
ConfigError – If
raise_on_missing
conditions are met