Skip to content

opm — Open Processing Model opm — Open Processing Model

Open Processing Model

Open Processing Model (opm) converts TEI 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 an entire edition of XML into a static website or prepare the data for an external static site generator. Instead of writing XSLT or XQuery, describe in XML how each element should be presented, and opm compiles it into a reusable Python module.

While originally conceived for documents following the TEI XML standard, the TEI Processing Model is in fact not limited to TEI, but works equally well for any other kind of text-centric XML.

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 get started, have a look at the short tutorial included in this documentation. To learn more about ODD as the underlying standard, it is best to read the TEI Publisher documentation. It also includes a more extensive 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
  • generate a static HTML reference site from an ODD (opm odd document), including processing models and the TEI Guidelines when you have p5.xml locally

Where to go next

Supporters

Development of opm is supported by:

An initiative of

  • e-editiones e-editiones

    e-editiones is a non-profit association under Swiss law, recognised as serving the public benefit, with no commercial interests.