from docx import Document from htmldocx import HtmlToDocx document = Document() new_parser = HtmlToDocx() # do stuff to document html = '<h1>Hello world</h1>' new ...