#metadata #bio-format #ome #imread

ome-metadata

Ome metadata as a rust/python structure

4 releases

Uses new Rust 2024

new 0.2.2 May 6, 2025
0.2.1 Apr 30, 2025
0.2.0 Apr 30, 2025
0.1.0 Apr 28, 2025

#648 in Images

Download history 237/week @ 2025-04-25 97/week @ 2025-05-02

334 downloads per month

MIT license

105KB
3K SLoC

ome-metadata

Open Microscopy XML metadata (https://www.openmicroscopy.org/Schemas/) as a collection of Rust structs and enums, with translation to Python.

Rust

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);

Python

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}")

Dependencies

~4–11MB
~124K SLoC