ConfigFramework package

Submodules

class BaseConfig(*args, _BaseConfig__passed_classes: Optional[Set[Type]] = None, **kwargs)[source]

Bases: object

Base class for configs you must inherit from if you want to write your own config class.

dump(include_defaults: Optional[bool] = None)NoReturn[source]

Writes variables updated values to their.

Parameters

include_defaults – represents dumping argument for all first_loader. In case you want to stay with including defaults defined by first_loader class - leave None config_var.

Returns

nothing.

class DumpCaster(casters_dict: Dict[Union[Type[AbstractConfigLoader], AnyStr], Callable])[source]

Bases: object

Class that is meant to help assigning specific dump caster function for different ConfigLoaders.

class ConfigVar(key: [Hashable, AnyStr], loader: AbstractConfigLoader, *, typehint: Optional[Type] = typing.Any, caster: Optional[Callable] = None, dump_caster: Optional[Callable, DumpCaster] = None, validator: Optional[Callable] = None, default: Optional[Any] = None, constant: bool = False)[source]

Bases: ConfigFramework.abstract.abc_variable.AbstractConfigVar

Represents any config variable that you can customize to your needs by adding some code.

class IntVar(key: [Hashable, AnyStr], loader: AbstractConfigLoader, *, dump_caster: Optional[Callable, DumpCaster] = None, validator: Optional[Callable] = None, default: Optional[Any] = None, constant: bool = False)[source]

Bases: ConfigFramework.abstract.abc_variable.AbstractConfigVar

Represents an integer config_var in your config.

class FloatVar(key: [Hashable, AnyStr], loader: AbstractConfigLoader, *, dump_caster: Optional[Callable, DumpCaster] = None, validator: Optional[Callable] = None, default: Optional[Any] = None, constant: bool = False)[source]

Bases: ConfigFramework.abstract.abc_variable.AbstractConfigVar

Represents an float config_var in your config.

class BoolVar(key: [Hashable, AnyStr], loader: AbstractConfigLoader, *, dump_caster: Optional[Callable, DumpCaster] = None, validator: Optional[Callable] = None, default: Optional[Any] = None, true_str_values: Tuple[AnyStr] = ('true', 't', 'y', '1'), constant: bool = False)[source]

Bases: ConfigFramework.abstract.abc_variable.AbstractConfigVar

Represents boolean variables in your config with customizable set of words that considered as correct.

caster(value: Any)bool[source]

Callable that should return variable casted to specific type (in case you need custom types).

Parameters

value – config_var to be casted.

Returns

value casted to whatever type you need.

constant_var(config_var: ConfigFramework.abstract.abc_variable.AbstractConfigVar)ConfigFramework.abstract.abc_variable.AbstractConfigVar[source]

Makes variable unable to be assigned on runtime.

Parameters

config_var – variable instance.

Returns

same ConfigVar instance, but its value can’t be reassigned on a runtime.