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.5.0.tar.gz (46.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

html2docx-1.5.0-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

File details

Details for the file html2docx-1.5.0.tar.gz.

File metadata

  • Download URL: html2docx-1.5.0.tar.gz
  • Upload date:
  • Size: 46.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for html2docx-1.5.0.tar.gz
Algorithm Hash digest
SHA256 b84cfef8776e256f510bb583896bcbf5a26b387150de72f403562469b141e16c
MD5 c8929f99bcdf9ac23aa15b3cf5d79bc4
BLAKE2b-256 9069b94c446e858f5654039747b140bb62fe4e8fe781f4be4253a528db1147ee

See more details on using hashes here.

File details

Details for the file html2docx-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: html2docx-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 35.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for html2docx-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09de975972f7f74d280bf22a2d3776fea02ce009f37963a552da2c47a9689711
MD5 927e15a92d9bf12c04625a97b3cc3e0a
BLAKE2b-256 16b0093abbb0755ed9a1fb2b473dbd014ac658e309b132df11c9b7d5f7cb2f33

See more details on using hashes here.

Supported by

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