🟣
Config
Config is a collection of blueprints.
__init__(env_prefix=None)
Initialize config with optional env prefix which should be applied to all blueprints.get_blueprints_by_type(cls: Type[T_Blueprint]) -> Dict[str,T_Blueprint]
Accept blueprint type (class). Return all blueprints of this type.add_blueprint(bp: AbstractBlueprint)
Accept instance of blueprint. Add blueprint to config. If blueprint with the samefull_name
already exists, replace it.add_error(path: Path, e: Exception)
Accept path object (usually to YAML config file) and instance of exception. Add config validation error.
- .env_prefix (str) - normalized env prefix, upper cased and with
__
at the end, should be used internally to build identifiers. - .blueprints (dict) - blueprints added to config.
- {key} (type) - blueprint type (class).
- {value} (dict)
- {key} (str) - full name of object, stored as string.
- {value} (blueprint) - blueprint dataclass object.
- .errors (list) - config validation errors.
- {items} (dict)
- path (Path) - path to file (or something else) which caused error.
- error (Exception) - exception object.
- {key} (str) - name of placeholder.
- {value} (bool, float, int, str) - value of placeholder.
Last modified 1yr ago