Skip to main content

Convert valid HTML input to docx.

Project description

html2docx

html2docx converts valid HTML input to docx output. The project is distributed under the MIT license.

Installing

To install, use pip:

$ pip install html2docx

Usage

from html2docx import html2docx

with open("my.html") as fp:
    html = fp.read()

# html2docx() returns an io.BytesIO() object. The HTML must be valid.
buf = html2docx(html, title="My Document")

with open("my.docx", "wb") as fp:
    fp.write(buf.getvalue())

Testing

To run the test suite, use tox:

$ tox

Project details


Download files

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

Source Distribution

html2docx-1.6.0.tar.gz (47.0 kB view hashes)

Uploaded Source

Built Distribution

html2docx-1.6.0-py3-none-any.whl (35.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page