get_config

get_config(module: str, key: str, *, passthrough: X | None = None, default: X | None = None, dtype: type[X] | None = None, raise_on_missing: bool = False) Any[source]

Get a configuration value.

Parameters:
  • module – Name of the module (e.g., pybel) to get configuration for

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

  • passthrough – If this is not none, will get returned

  • default – If the environment and configuration files don’t contain anything, this is returned.

  • dtype – The datatype to parse out. Can either be int(), float(), bool(), or str(). If none, defaults to str().

  • raise_on_missing – 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