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.
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 havep5.xmllocally
Where to go next¶
- New here? Start with Installation and the Quickstart, or follow one of the tutorials: Convert XML to HTML, Publish a website, Create a PDF, EPUB and Word.
- Working with an AI assistant? Point it to llms.txt or llms-full.txt, plain-text versions of this documentation written for AI tools.
- Learn the concepts: ODD files,
Output formats,
XPath extensions,
Templates & CSS,
Chunking,
ODD documentation,
Integration with TEI Publisher, and the
opm.tomlconfiguration. - Reference: the CLI and the Python API.
Supporters¶
Development of opm is supported by: