ome-types
Python dataclasses for the OME data model
What it is and what it does
ome-types is a pure-Python library that converts OME-XML microscopy metadata into fully-typed Python dataclasses and back again. It parses OME-XML files or extracts metadata from OME-TIFF images into an object model where all OME concepts (Image, Plate, Pixels, Channel, etc.) are accessible as snake_case attributes on Python objects. You can then read, modify, or construct new metadata programmatically and serialize it back to valid OME-XML.
The library depends on pydantic, pydantic-core, pydantic-extra-types, and xsdata for schema validation and XML handling. It does not require a Java virtual machine, making it lightweight for Python-native workflows. Most of the model code is generated at install time from the OME schema, ensuring consistency with the OME-2016-06 specification.
Use it for:
- Extract and inspect microscopy acquisition metadata from OME-TIFF files in Python without external tools.
- Programmatically modify OME metadata (e.g., update physical pixel sizes, add instrument details) and write back to OME-XML.
- Validate OME-XML documents against the OME schema and convert between XML and Python object representations.
- Build OME-compliant metadata from scratch by constructing Instrument, Microscope, Objective, and Image objects.
- Integrate OME metadata handling into scientific image processing pipelines written in Python.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parse and manipulate OME-XML microscopy metadata as fully-typed Python objects, and serialize them back to valid OME-XML format without requiring a Java runtime.
Yes, if you work with OME-XML or OME-TIFF microscopy data in Python. The library is stable, has no known vulnerabilities, and low install friction. The aging maintenance status (261 days since last release) is a minor concern for long-term schema compatibility, but the package remains functional and the repository is not archived. Install with optional dependencies (lxml, pint) only if you need XML validation or unit quantity support.
Install
ome-types on PyPI
pip
pip install ome-typesuv
uv add ome-typespoetry
poetry add ome-typesInstalling ome-types
Before you install
Low install friction with a pure-Python wheel. Maintenance status is aging—last release was 261 days ago and the repository shows minimal activity (1 star), though it remains actively maintained with a recent commit on 2026-02-12.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions; attribution is required but no copyleft obligations apply.
Quickstart
pip install ome-types
from ome_types import from_xml
ome = from_xml('path/to/file.ome.xml')
print(ome.images[0].pixels.physical_size_x)
Requires Python 3.9 or later. Optional dependencies (lxml, pint, xmlschema) needed for XML validation or unit quantity properties.
Verify before relying
- Whether the aging maintenance status (261 days since release) poses risk for long-term compatibility with evolving OME schema versions.
- Performance characteristics when parsing large or deeply nested OME-XML documents.
- Completeness of OME-2016-06 schema coverage and support for newer OME schema versions.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — pydantic-core, pydantic-extra-types, pydantic, xsdata |
| Maintenance | aging — 261 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 178,508/month — #10,190 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ome_types-0.6.3-py3-none-any.whl
Keywords: microscopy, ome, ome-model, schema, types
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
ome-zarrReads and writes multi-resolution images stored…
permissive · top 15,000 on PyPI
SickleSickle is a lightweight Python client library…
permissive · top 15,000 on PyPI
tifffileRead and write TIFF files and TIFF-like formats…
permissive · top 1,000 on PyPI
maecParse, manipulate, and generate MAEC (Malware…
permissive · top 15,000 on PyPI
xsdataxsdata generates Python dataclasses from XML…
permissive · top 5,000 on PyPI
lxmllxml provides Python bindings to libxml2 and…
permissive · top 1,000 on PyPI
pydantic-xmlPydantic-xml adds XML serialization and…
permissive · top 5,000 on PyPI
pykmlpyKML parses and creates KML documents using a…
permissive · top 15,000 on PyPI
xml-pythonConverts XML documents into Python objects,…
copyleft · top 5,000 on PyPI
types-lxmlProvides complete external type annotations for…
permissive · top 5,000 on PyPI