config_framework.types.abstract package

Submodules

class AbstractLoader(data: MutableMapping[str, Any], defaults: MutableMapping[str, Any])[source]

Bases: MutableMapping, ABC

Class that is used as configuration data source.

data: MutableMapping[str, Any]
defaults: MutableMapping[str, Any]
lookup_data: MutableMapping[str, Any]
get(key: Union[VariableKey, str], default: Optional[Any] = None) Any[source]

Gives a value under specific key and if not found gives default value.

Returns

anything.

abstract dump(include_defaults: bool = False) None[source]

Method that is used to dump all values to some storage.

Parameters

include_defaults – specifies if you want to have default variables to be dumped.

Returns

nothing.

dump_to(other_loader: AbstractLoader, include_defaults: bool = False) None[source]

Assigns data and defaults values from itself to other loader and then calling dump method with provided include_defaults value.

Parameters
  • other_loader – other initialized loader.

  • include_defaults – specifies if you want to have default variables to be dumped.

Returns

nothing.

Raises

ValueError – if received not an instance of AbstractLoader subclass.