Skip to main content

Convert html to docx

Project description

htmldocx

Convert html to docx

Dependencies: python-docx & bs4

To install

pip install htmldocx

Usage

Add strings of html to an existing docx.Document object

from docx import Document
from htmldocx import HtmlToDocx

document = Document()
new_parser = HtmlToDocx()
# do stuff to document

html = '<h1>Hello world</h1>'
new_parser.add_html_to_document(html, document)

# do more stuff to document
document.save('your_file_name')

Convert files directly

from htmldocx import HtmlToDocx

new_parser = HtmlToDocx()
new_parser.parse_html_file(input_html_file_path, output_docx_file_path)

Convert files from a string

from htmldocx import HtmlToDocx

new_parser = HtmlToDocx()
docx = new_parser.parse_html_string(input_html_file_string)

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

htmldocx-0.0.5.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

htmldocx-0.0.5-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file htmldocx-0.0.5.tar.gz.

File metadata

  • Download URL: htmldocx-0.0.5.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for htmldocx-0.0.5.tar.gz
Algorithm Hash digest
SHA256 43e9c6ccff05fb6ae85598b787fcbb88d5567c5e278c8021e5a2509d24aad349
MD5 9490c49dcc7cecd4b4b493a4969d7538
BLAKE2b-256 651677e9fc17c06f06eb56cdedaf798bc3e1431ff6432c597625a8fa00c1629e

See more details on using hashes here.

File details

Details for the file htmldocx-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: htmldocx-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for htmldocx-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 df9c20ccd39fd83a8a3d9c8b99b64f68ca19cc0589dc8a8567a54fba27cb1a36
MD5 2c3578731d5631c5d5345e0ddad387a7
BLAKE2b-256 a65224929fd02f12b58c03148aaba9efc1719158f370a4acb95b2f612c59077d

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