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 for

  • key (str) – Name of the key (e.g., connection)

  • passthrough (Optional[TypeVar(X)]) – If this is not none, will get returned

  • default (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 be int(), float(), bool(), or str(). If none, defaults to str().

  • 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