Skip to main content

opm — Open Processing Model

Open Processing Model

Open Processing Model (opm) implements the TEI Processing Model for transforming XML into various output formats. The design conceptually follows the tei-publisher-lib implementation in TEI Publisher and aims to be as compatible as possible. 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 a worked example project

opm transform data/sample.xml --preview
opm chunk data/sample.xml --force
opm serve

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 worked 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/

# Worked 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

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.9.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.9.0
File Size Uploaded
open_processing_model-0.9.0.tar.gz 2.7 MB Details

Built distribution (wheel)

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

Total release size: 3.4 MB

Release files / open_processing_model-0.9.0.tar.gz

Download URL open_processing_model-0.9.0.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
87d0d2e4546bfd688474278d9adc60b0485733525c1151bb6c21de0fcaa594b0
BLAKE2b-256 checksum
How to use checksums
0147f0146708f400be781e4238b9919a205a5b6bf25625c73fbbf78d0445a8bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

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

Download URL open_processing_model-0.9.0-py3-none-any.whl
Size 647.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac0dfd2eeb1f100cd59603d3b87ec98605f63c90d1f7feacb43fecaf44b430b3
BLAKE2b-256 checksum
How to use checksums
4af1efaaf2d007da32ce922d811092146414b1e79f099add6c82b093601fd152
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

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