Dict IO Adapter Class#
- class expectmine.io.adapters.dict_io_adapter.DictIoAdapter(answers: dict[str, dict[str, object]], **kwargs: Dict[Any, Any])[source]#
Bases:
BaseIoAdapterAdapter to DictIo which takes a dict of dicts as argument (namely a dict for each step) and creates instances with config values for each step instance. If configuration values exist for each step instance, it will create instances accordingly; otherwise, it will raise an error.
- __init__(answers: dict[str, dict[str, object]], **kwargs: Dict[Any, Any])[source]#
Creates a factory for producing scoped io.
- get_instance(step_name: str, **kwargs: Dict[Any, Any]) BaseIo[source]#
Produces a scoped instance of type BaseIo.
- Parameters:
step_name (str) – The scope of the instance
- Returns:
A scoped instance of io.
- Return type:
- Example:
>>> get_instance("Instance 1") BaseStore
>>> get_instance("") ValueError("Step name can not be empty.")
- Raises:
TypeError – If the arguments have the wrong type.
ValueError – If step name is too long or empty.