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.
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¶
- New here? Start with Installation and the Quickstart.
- Learn the concepts: ODD files,
Output formats,
XPath extensions,
Templates & CSS,
Chunking,
Integration with TEI Publisher, and the
opm.tomlconfiguration. - Reference: the CLI and the Python API.
Supporters¶
Development of opm is supported by: