pypdf2htmlex is a Python wrapper for the PDF2HTMLEX
pip install pypdf2htmlex
import pypdf2htmlEX
pdf = pypdf2htmlEX.PDF("path-to-my-file.pdf")
pdf.to_html()
# will be generated a html file on folder path-to-my-file
can pass True for drm parameter to convert a file to html without restrition the value is False by default
import pypdf2htmlEX
pdf = pypdf2htmlEX.PDF("path-to-my-file.pdf", drm=True)
pdf.to_html()