Skip to content

Configuration IO

Source

I/O functions for Configuration objects.

load_configuration(path)

Load configuration from a yaml file.

Parameters:

Name Type Description Default
path str or Path

Path to the configuration.

required

Returns:

Type Description
Configuration

Configuration.

Raises:

Type Description
FileNotFoundError

If the configuration file does not exist.

load_configuration_ng(path)

Load configuration from a yaml file.

Parameters:

Name Type Description Default
path str or Path

Path to the configuration.

required

Returns:

Type Description
Configuration

Configuration.

Raises:

Type Description
FileNotFoundError

If the configuration file does not exist.

save_configuration(config, path)

Save configuration to path.

Parameters:

Name Type Description Default
config Configuration

Configuration to save.

required
path str or Path

Path to a existing folder in which to save the configuration, or to a valid configuration file path (uses a .yml or .yaml extension).

required

Returns:

Type Description
Path

Path object representing the configuration.

Raises:

Type Description
ValueError

If the path does not point to an existing directory or .yml file.