Skip to main content

Convert html to docx

Project description


Convert html to docx

Dependencies: python-docx & bs4

To install

pip install htmldocx


Add strings of html to an existing docx.Document object

from docx import Document
from htmldocx import HtmlToDocx

document = Document()
new_parser = HtmlToDocx()
# do stuff to document

html = '<h1>Hello world</h1>'
new_parser.add_html_to_document(html, document)

# do more stuff to document'your_file_name')

Convert files directly

from htmldocx import HtmlToDocx

new_parser = HtmlToDocx()
new_parser.parse_html_file(input-html-file, output-docx-file)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for htmldocx, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size htmldocx-0.0.4-py3-none-any.whl (7.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size htmldocx-0.0.4.tar.gz (6.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page