Skip to main content

get_config

Converts a dictionary or object into a BaseConfig subclass by mapping its attributes or keys to the new class.

def get_config(
config: Union[ConfigDict, Type[object], None]
) - > Type[BaseConfig]

Resolves and constructs a configuration class by merging provided settings with the default BaseConfig. Use this to normalize configuration inputs from dictionaries or objects into a standardized class structure.

Parameters

NameTypeDescription
configUnion[ConfigDict, Type[object], None]The source configuration data, which can be a dictionary, a class/object containing settings, or None to use defaults.

Returns

TypeDescription
Type[BaseConfig]A configuration class inheriting from BaseConfig with all provided settings applied as class attributes.