Skip to main content

opm — Open Processing Model

Open Processing Model

Open Processing Model (opm) converts TEI XML, and other XML such as DocBook or JATS, into HTML, PDF (via Typst), EPUB, Word, Markdown or JSON. It can also be used to transform a TEI edition into a static website, prepare the data for an external static site generator, or index documents for a search engine.

Instead of writing XSLT or XQuery, describe how each element should be presented in a TEI ODD document, and opm compiles it into a reusable Python module.

opm is an implementation of the TEI Processing Model standard in Python. The TEI Processing Model was created to allow publishers, editors or scholars to transform documents without becoming programmers. Knowing XML, TEI and basic XPath is enough. Instead of writing XSLT or XQuery, you describe in TEI how each element should be presented.

The design of opm follows the tei-publisher-lib implementation in TEI Publisher and aims to be as compatible as possible, so ODDs can be shared between both. While tei-publisher-lib compiles the processing model instructions found in an ODD into XQuery code, opm outputs Python instead.

opm does not require a database, runs entirely on the command line, is very fast for batch processing and has very slim dependencies.

👉 Documentation: Read the full documentation here.

Quick start

Python ≥ 3.12. Install the package, then scaffold a project:

pip install open-processing-model
# or: uv add open-processing-model

opm init                          # asks: empty project, or one of the examples
# opm init --vocabulary docbook   # empty DocBook project, no prompt
# opm init --example jats         # copy of an example project

opm transform data/sample.xml --preview
opm chunk data/sample.xml --force
opm serve
opm odd document my.odd --force --preview         # ODD documentation site

A one-off transform needs no project files (opm transform my.xml --preview uses the packaged stock ODD and templates). opm init writes editable opm.toml, templates, CSS, and an ODD — or, with --example, copies one of the example projects under examples/ (--list-examples shows them).

Development

This repository uses uv. From a clone:

uv sync

uv run opm transform examples/tei-test.xml --preview
uv run opm transform examples/tei-test.xml -t web --preview
uv run opm chunk examples/tei-test.xml -o chunks/ --force
uv run opm serve -d chunks/

# Example projects (run from the example directory):
cd examples/serafin && uv run opm chunk data/letters/serafin01.xml --force --preview
cd examples/docbook && uv run opm chunk data/doc/quickstart.xml --force --preview
cd examples/jats && uv run opm chunk data/article/hertziana-digital-editions.xml --force --preview
cd examples/odd && uv run opm odd document --force --preview   # the TEI Guidelines

opm without uv run

To get opm on your PATH while still running the working tree, install the clone as an editable tool:

uv tool install --editable . --force

Code changes are picked up straight away — the tool venv links to src/, so there is nothing to re-sync after an edit. Dependency changes are not: when [project] dependencies in pyproject.toml gains an entry, run the same command again, or the installed opm keeps the dependency set it was resolved with and fails on the new import.

Note that .venv/bin/opm shadows the tool whenever the project venv is on PATH; which -a opm shows which one you are about to run.

See CONTRIBUTING.md before opening a pull request — contributions require a one-click contributor license agreement.

Tests

uv sync --group dev
uv run --group dev pytest                            # all tests
uv run --group dev pytest tests/test_odd_compiler.py # single file

Documentation

The docs site is built with Zensical (successor to Material for MkDocs, plus mkdocstrings). To preview locally:

uv sync --group docs
uv run python scripts/gen_cli_docs.py                # refresh CLI reference from the Typer app
uv run --group docs zensical serve                   # http://127.0.0.1:8000
uv run --group docs zensical build                   # static site into ./site

Supporters

Development of opm is supported by:

Ernst Göhner Stiftung      Swiss Academy of Humanities and Social Sciences      Zentralbibliothek Zürich

Karl Barth-Stiftung
Karl Barth-Stiftung, Universität Basel

Universität Zürich
Zentrum Digitale Editionen & Editionsanalytik, Universität Zürich

An initiative of

e-editiones

License

Copyright © 2026 e-editiones. Licensed under the GNU Affero General Public License, version 3 or later, with additional permissions.

The AGPL means that if you build on opm and offer it to others — including as a hosted service — your users are entitled to the source. Members of e-editiones may instead use opm under the LGPL, which lifts that obligation: see LICENSING.md, Part B. Membership funds the long-term maintenance of TEI Publisher and its tooling.

LICENSING.md, Part A grants everyone additional permissions under AGPL §7: invoking opm as a separate process leaves your program alone, transform modules compiled from your ODDs are yours to license and to execute, so are XPath extension modules, and the files opm init writes into your project are released under CC0. Vendoring opm's own source into your tree is the case those permissions do not cover.

Documents you transform with opm are your own; the licence does not reach the output. See the licensing guide for where the line falls in practice.

Metadata

Release files for open-processing-model 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for open-processing-model 0.10.0
File Size Uploaded Provenance Actions
open_processing_model-0.10.0.tar.gz 3.9 MB With provenance Details for open_processing_model-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for open-processing-model 0.10.0
File Interpreter ABI Platform Actions
open_processing_model-0.10.0-py3-none-any.whl Python 3 none any Details for open_processing_model-0.10.0-py3-none-any.whl

Total release size: 5.6 MB

Release files / open_processing_model-0.10.0.tar.gz

Download URL open_processing_model-0.10.0.tar.gz
Size 3.9 MB
Tags Source
SHA-256 checksum
How to use checksums
d836c88fc7bec527ddc2ccd71ce85cbeea14ff7ffb47bf0b12f813abcc71f328
BLAKE2b-256 checksum
How to use checksums
8daec1d959afa53ed671461d8dfc1931cced859b6d2ec84313dd050dc04631c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / open_processing_model-0.10.0-py3-none-any.whl

Download URL open_processing_model-0.10.0-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2f5ad12c80e88d3838fce351cad12af37e4e354dea20d60dfcd6a45bd18d399b
BLAKE2b-256 checksum
How to use checksums
9422cc55e984d19d36294d13d7591947d693b6d55df8aea7b2365e2bc444ae1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for open-processing-model 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for open_processing_model-0.10.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page