Open Processing Model Release

e-editiones community call

September 15, 2026

Wolfgang Meier

Open Processing Model

  • an implementation of the TEI Processing Model in Python
  • lightweight, blazingly fast, few dependencies
opm chunking demo

Use for

  • quick preview of documents
  • batch transformation of large collections
  • pre-rendering content for TEI Publisher
  • producing an entirely static website

OPM vs tei-publisher-lib

  • benefits from lessons learned, but a completely fresh implementation
  • opm compiles ODD to Python where tei-publisher-lib compiles to XQuery
  • same extensions to the spec as tei-publisher-lib
  • ODDs can be shared between implementations!

Code Comparison

tei-publisher-lib:

case element(p) return
    html:paragraph($config, ., css:get-rendition(., ("tei-p", "tei-p3", css:map-rend-to-class(.))), .)
case element(list) return
    html:list($config, ., css:get-rendition(., ("tei-list", "tei-list1", css:map-rend-to-class(.))), child::node(), ())

opm:

case 'p':
    return pmf.paragraph(config, node, ['tei-p', 'tei-p3', r], node)
case 'list':
    return pmf.list(config, node, ['tei-list', 'tei-list1', r], config.xpath.select(node, 'child::node()'))

Differences

  • opm is XPath 3.1 only! no XQuery
  • no database: additional documents/collection need to be configured up front
  • extension/helper functions must be in python

Output Modes

  • web: HTML pages
  • markdown (extends plain): plain text markdown
  • epub (extends web): ePub books
  • typst: high quality print PDF (similar to LaTeX)
  • print (extends web): HTML with CSS for print
  • docx: Word document
  • json: traces how the ODD transformed the input (logging and debugging)

Commands: init

  • scaffold a project
  • empty project using TEI, docbook or JATS
  • extend one of the examples
opm init demo

Commands: transform

  • transforms single input to single output
  • best for quick previews, exports or print production
opm transform demo

Commands: chunk

  • paginate large documents
  • batch process entire collections
  • one XML document may generate multiple output fragments
  • web output mode only
opm chunking demo

Chunk Formats

  • html: output rendered through Jinja2 template
  • json: ideal to export data to a static site generator
  • pb-view: TEI Publisher's format for pre-rendered content views

Command: index

  • produce JSON ideal for import into external search engine
  • index the actual reading view
  • chunk large sections with overlap (min_chars/max_chars)
  • attach additional fields/facets
opm with astro demo

License

  • AGPL version 3
  • Members use LGPL version 3!
  • configurations, templates + generated code: CC0 1.0 Universal
  • e-editiones relies on membership
  • give something back to the people and institutions supporting it

Links

Supporters

  • Ernst Göhner Stiftung
  • Swiss Academy of Humanities and Social Sciences
  • Zentralbibliothek Zürich
  • Universität Zürich Zentrum Digitale Editionen & Editionsanalytik
  • Karl Barth-Stiftung Karl Barth-Stiftung