Overview
I had the opportunity to convert TEI/XML files to EPUB using Python, so here are my notes.
While Oxygen XML Editor is one method for converting TEI/XML files to EPUB, this time I used the Python library “EbookLib.” I referenced the following article.
https://dev.classmethod.jp/articles/try-create-epub-by-python-ebooklib/
In particular, this time the goal is to create a vertical-text EPUB from the TEI/XML files published in the “Koui Genji Monogatari Text Data Repository.”
Conversion Method
The source code is available in the following notebook.
Results
As shown below, you can view the Koui Genji Monogatari text in an EPUB-compatible reader.

By modifying the HTML and CSS, I believe various display styles can be achieved.
I hope this serves as a useful reference for utilizing TEI/XML.