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.2.0.tar.gz
(45.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
html2docx-1.2.0-py3-none-any.whl
(35.1 kB
view details)
File details
Details for the file html2docx-1.2.0.tar.gz.
File metadata
- Download URL: html2docx-1.2.0.tar.gz
- Upload date:
- Size: 45.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0869bd83a60a353e1ac2b3efda42a6b7e78c82a21f5561efa444f6e3fcd38e7
|
|
| MD5 |
8fc454ea00af7245ed752c98cd6c14c9
|
|
| BLAKE2b-256 |
c57a5376e1ca9e1079968fe442125d05165ddd78f430a6b6c61113492a0d5a20
|
File details
Details for the file html2docx-1.2.0-py3-none-any.whl.
File metadata
- Download URL: html2docx-1.2.0-py3-none-any.whl
- Upload date:
- Size: 35.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a059ea94da46a38600fd542e60f2e463bc21371bcb47e019b14d0b19e12a5c1f
|
|
| MD5 |
e165c37b21e526eb10e2562575bdc734
|
|
| BLAKE2b-256 |
cbd40935eec1dd82f3abbd1713db76466588a597bb4be7d11aedc0677cf55588
|