nicetoolbox.configs.config_handler.load_validated_config_raw

nicetoolbox.configs.config_handler.load_validated_config_raw(config_filepath: str, schema: Type[ModelT]) dict[source]

Load a configuration file, validate it using a Pydantic model and return the raw dictionary.

Parameters:
  • config_filepath (str) – Path to the config file.

  • schema (Type[ModelT]) – Pydantic model class used to validate.

Returns:

Raw config dictionary.

Return type:

dict

Raises:
  • IOError – When an array with no valid (existing)

  • FileNotFoundError – If the file does not exist.

  • NotImplementedError – If the file type is not supported.

  • TomlDecodeError – Error while decoding toml

  • ConfigValidationError – If validation fails.