Reference#

class classy_config.ConfigValue(variable_path: str, _type: Type[T], deliminator: str = '.')#

Bases: object

Resolve to a value defined within the config.

classy_config.register_config(filepath: str | ~pathlib.Path, prefix: str | None = None, loader: ~classy_config.loader.loader.Loader = <function auto_loader>, strict: bool = False) None#

Register a config file to load from.

Parameters:
  • filepath – Path to the config to load.

  • prefix – Prefix all config values loaded.

  • loader – Loader to user for gathering values from config file. The default auto_loader will resolve a loader from the config file’s extension.

  • strict – If strict, any duplicate keys will raise a ValueError. If not strict, duplicate keys will attempt to be merged if both values are dicts.

Returns:

classy_config.register_loader(extension: str, loader: Loader) None#

Register a loader for the auto_loader to use. This will resolve a loader from the provided extension.

Parameters:
  • extension – The file extension this loader will be assigned to.

  • loader – The loader function.

Returns:

Subpackages#