spine.config.load.load_config_file
- spine.config.load.load_config_file(cfg_path: str, download: bool = True) Dict[str, Any][source]
Load a SPINE configuration from a file.
Convenience function that reads a configuration file and passes it to load_config. The file’s directory is automatically used as root_dir for include resolution.
- Parameters:
cfg_path (str) – Path to configuration file
download (bool, default True) – If True, resolve !download tags by downloading files. If False, preserve !download tags as unresolved values.
- Returns:
Loaded and merged configuration
- Return type:
Dict[str, Any]
- Raises:
ConfigCycleError – If circular include detected
ConfigIncludeError – If included file not found or can’t be loaded
ConfigPathError – If removal/operation targets non-existent path (when strict=”error”)
ConfigTypeError – If operation applied to wrong type
ConfigOperationError – If invalid operation specified
Examples
>>> config = load_config_file("config.yaml") >>> print(config['io']['reader']['batch_size']) 32
See also
load_configLoad config from a YAML string