read_config#

caput.config.Reader.read_config(config: dict, compare_keys: bool | list[str] = False, use_defaults: bool = True) None[source]#

Set all properties in this class from the supplied config.

Parameters:
configdict

Dictionary of configuration values.

compare_keysbool | list[str], optional

If True, a CaputConfigError is raised if there are unused keys in the config dictionary. If a list of strings is given, any unused keys except the ones in the list lead to a CaputConfigError.

use_defaultsbool, optional

If False, a CaputConfigError is raised if a property is not defined by the config dictionary

Raises:
CaputConfigError

If there was an error in the config dict.