write_dict

glotaran.builtin.io.yml.utils.write_dict(data: Mapping[str, Any] | Sequence[Any], file_name: str | Path | None = None, offset: int = 0) str | None[source]

Write a mapping (e.g. dict) or sequence (e.g. list) as yaml to file or str.

Parameters:
Returns:

String if file_name is None or None if file_name is a valid path.

Return type:

str | None