Note: (on the off chance that someone did not know about this :) ) The author is also the only developer of calibre. https://calibre-ebook.com/ which is also based on python
I have worked on document formats (office, pdf etc) and I understand these standards are simply tedious!