fromdict

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

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

Parameters
  • dataclass_type (type) – 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

object