Skip to content

opm — Open Processing Model opm — Open Processing Model

Open Processing Model

Open Processing Model (opm) is an implementation of the TEI Processing Model in Python. It provides a command-line client and library for transforming XML documents — TEI, DocBook, and others — into (currently) HTML, Markdown, DOCX, Typst, HTML for print and ePub. Instead of being hard-coded in XSLT or XQuery, transformation rules are declared in a TEI ODD document, which opm compiles into a reusable Python module.

opm is pure Python with minimal dependencies and implements the full TEI Processing Model. Most ODDs will be compatible and can be exchanged between TEI Publisher and opm, allowing users to combine the benefits of a dynamic, database-backed website with the speed of static rendering.

To learn more about ODD, it is best to read the TEI Publisher documentation. It also includes a small tutorial in the Gentle Introduction document.

First page of the Serafin typst sample
Letter sample (PDF via typst) Open the PDF
Web preview of a journal article
Web preview of journal article Using JATS XML format
Second page of the Shakespeare sample
Shakespeare play (PDF via typst) Open the PDF
Static web page screenshot
Static web presentation Plain HTML + CSS produced by opm
Static web page using Astro
Full static web site opm JSON output powering an Astro-based website
EPUB preview screenshot from the Gentle Introduction sample
EPUB sample using TEI Publisher documentation Download the EPUB

Uses

Typical usage scenarios for opm include:

  • quick transformation of XML documents on the command line
  • split large documents into chunks, so they can be read page by page
  • prepare HTML data to be used by other systems such as static site generators
  • provide pre-rendered content for TEI Publisher to speed up load times

Where to go next

Supporters

Development of opm is supported by:

An initiative of