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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
html2docx-1.5.0-py3-none-any.whl
(35.4 kB
view hashes)
Close
Hashes for html2docx-1.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09de975972f7f74d280bf22a2d3776fea02ce009f37963a552da2c47a9689711 |
|
MD5 | 927e15a92d9bf12c04625a97b3cc3e0a |
|
BLAKE2b-256 | 16b0093abbb0755ed9a1fb2b473dbd014ac658e309b132df11c9b7d5f7cb2f33 |