Skip to main content

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

Metadata

Release files for html2docx 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for html2docx 1.6.0
File Size Uploaded Provenance Actions
html2docx-1.6.0.tar.gz 47.0 kB Without provenance Details for html2docx-1.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for html2docx 1.6.0
File Interpreter ABI Platform Actions
html2docx-1.6.0-py3-none-any.whl Python 3 none any Details for html2docx-1.6.0-py3-none-any.whl

Total release size: 82.7 kB

Release files / html2docx-1.6.0.tar.gz

Download URL html2docx-1.6.0.tar.gz
Size 47.0 kB
Tags Source
SHA-256 checksum
How to use checksums
13ef5653d7a3ffe625251705f15ae203938ce2f98be93e62f6fdf80630c33d2d
BLAKE2b-256 checksum
How to use checksums
c06ca1122f2fe5a772b0c63e0a4966c7ae093f81ff23aa8ee04bba6b69c54e40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / html2docx-1.6.0-py3-none-any.whl

Download URL html2docx-1.6.0-py3-none-any.whl
Size 35.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec7ceacb53eaf4ad5217d96f61dbd5cd62bc6f28d3830e4721e5428300255bdf
BLAKE2b-256 checksum
How to use checksums
97f2291d81ff6699c3874cd4143cd2815bd82f8d4129c6ef7bfdfcd410db6132
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Security for html2docx 1.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page