fromdict

glotaran.project.dataclass_helpers.fromdict(dataclass_type: type[DataclassInstanceType], dataclass_dict: dict[str, Any], folder: Path | None = None) DataclassInstanceType[source]

Create a dataclass instance from a dict and loads all file represented fields.

Parameters:
  • dataclass_type (type[DataclassInstanceType]) – A dataclass type.

  • dataclass_dict (dict[str, Any]) – A dict for instancing the the dataclass.

  • folder (Path) – The root folder for file paths. If None file paths are consider absolute.

Returns:

Created instance of dataclass_type.

Return type:

DataclassInstanceType