ImportTool

Plugin-aware tool for importing configurable unit facades from JSON files.

Member Functions:

import_config_unit

import_config_unit(
    folder_path: str,
    *,
    data_model_type: type[ConfigUnitDataModel] | None = None,
)

Import a single configurable unit facade from a folder of JSON schema files.

Parameters
Name Type Description

folder_path

str

Path to a folder containing configurable unit JSON schema files.

data_model_type

type[ConfigUnitDataModel] | None

Optional explicit ConfigUnitDataModel type.

Returns

ConfigUnitFacade — Imported configurable unit facade.

Raises:

  • FileNotFoundError — If folder_path does not exist.

  • ValueError — If folder_path is not a directory or auto-detection fails.

  • TypeError — If no registration exists for the resolved model type.

try_import_config_units

try_import_config_units(root_folder_path: str)

Import all configurable units found in immediate subfolders of a root directory.

Parameters
Name Type Description

root_folder_path

str

Root directory whose subdirectories each represent one configurable unit.

Returns

dict[type[ConfigUnitFacade], ConfigUnitFacade] — Mapping from facade type to imported facade instance.

Raises:

  • FileNotFoundError — If root_folder_path does not exist.

  • ValueError — If root_folder_path is not a directory.