Investigate pypandoc as .docx generator from html
https://github.com/NicklasTegner/pypandoc
import pypandoc
import tempfile
with tempfile.NamedTemporaryFile(suffix='.docx', delete=False) as outputfile:
output = pypandoc.convert(source=self.protocol_html(), format='html', outputfile=outputfile.name, to='docx', extra_args=['-RTS'])
investigate this lib efficiency and speed. Check if we can precompile this doc from html template
styles should be the same as html version has