1

In windows, document file ends with .docx

To convert the content of .docx file to HTML string, i used mammoth package and everything works perfectly.

Now i face with .odt file in Unix system, which is using LibreOffice.

The problem is: Is there any package like Mammoth to convert .odt file to HTML?

If there is no choice, maybe i have to convert from .odt file to .docx file, just to reuse mammoth. Is there any package of python to do it?

Thank you in advance!

Quang Thái
  • 649
  • 5
  • 17

1 Answers1

3

Have you tried looking at the https://pypi.org/project/odfpy/ package? It seems to be a pretty handy wrapper for manipulating ODT files.

More specifically inside that package there seems to be a function / API that allows you to convert an ODT file into some form of HTML so try looking at that.

odf2xhtml - Convert ODF to (X)HTML on the package link should point you in the right direction. I wish you the best of luck!

MayTusek
  • 31
  • 1