Crates.io | ome-metadata |
lib.rs | ome-metadata |
version | 0.2.2 |
created_at | 2025-04-28 18:38:50.435619+00 |
updated_at | 2025-05-06 13:37:22.886377+00 |
description | Ome metadata as a rust/python structure. |
homepage | https://github.com/wimpomp/ome-metadata |
repository | https://github.com/wimpomp/ome-metadata |
max_upload_size | |
id | 1652541 |
size | 386,085 |
Open Microscopy XML metadata (https://www.openmicroscopy.org/Schemas/) as a collection of Rust structs and enums, with translation to Python.
use std::fs::read_to_string;
use ome_metadata::Ome;
let xml = read_to_string($file)?;
let ome: Ome = xml.parse()?;
let image = &ome.image.unwrap()[0];
println!("acquisition date: {:#?}", image.acquisition_date);
from ome_metadata import Ome
with open($file) as f:
xml = f.read()
ome = Ome.from_xml(xml)
image = ome.image[0]
print(f"acquisition date: {image.acquisition_date}")