mihcsme_py.writer#
mihcsme_py.writer
#
Write MIHCSME metadata to Excel format.
fill_template(metadata: MIHCSMEMetadata, output_path: Union[Path, BinaryIO], template_path: Union[str, Path, None] = None) -> None
#
Write MIHCSME metadata into the official MIHCSME Excel template.
Unlike :func:write_metadata_to_excel, this keeps the full template layout:
every field (also empty ones), the descriptions/examples column, the
dropdown validations and the ontology reference sheets.
- Values are written into the Value column of matching (group, key) rows. Value cells of template rows without metadata are cleared.
- Fields not present in the template are appended below the existing rows.
- Data collaborators fill the template's collaborator rows in order; extra collaborators are appended.
- AssayConditions keeps the template columns; extra condition keys are added as new columns and existing data rows are replaced.
:param metadata: MIHCSMEMetadata object to export :param output_path: Path to output Excel file, or a file-like object (e.g., BytesIO) :param template_path: Optional custom template; defaults to the bundled LEI-MIHCSME template
Source code in src/mihcsme_py/writer.py
write_metadata_to_excel(metadata: MIHCSMEMetadata, output_path: Union[Path, BinaryIO]) -> None
#
Write MIHCSME metadata to Excel file.
All sheets are always written, even if empty, so the file can be used as a template. The AssayConditions sheet uses default column headers when no conditions are present.
:param metadata: MIHCSMEMetadata object to export :param output_path: Path to output Excel file, or a file-like object (e.g., BytesIO)