skillfed

htmldocx

Convert html to docx

htmldocx v0.0.6 1.2M downloads/30d#4,229 on PyPI89
Permissive license DORMANT released

What it is and what it does

htmldocx bridges HTML and Microsoft Word by converting HTML markup into .docx documents using python-docx as its rendering engine and beautifulsoup4 for HTML parsing. It offers three main workflows: adding HTML snippets to an existing Document object, parsing a complete HTML file into a new document, or converting an HTML string directly to a docx object. You can also configure table styling, including applying built-in Word styles or adding borders via the TableGrid style.

The package is straightforward for simple HTML-to-Word conversions but is no longer actively maintained—the last release was in 2021 and development has been dormant since then. It works with Python 3.6 and later and depends only on two well-established libraries, making installation frictionless.

Use it for:

  • Generate Word documents from HTML templates in web applications or report generators
  • Convert HTML email content or web pages into downloadable .docx files for users
  • Batch convert HTML files to Word documents as part of a document processing pipeline
  • Add HTML-formatted content to existing Word documents programmatically

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts HTML content into Microsoft Word documents (.docx format), either by adding HTML to existing documents or parsing HTML files and strings directly into new documents.

Yes, if you need basic HTML-to-Word conversion and can accept dormant maintenance. The package is stable, has no known vulnerabilities, and handles common use cases well. However, if you require active bug fixes, new HTML feature support, or compatibility assurance with the latest python-docx versions, consider whether the lack of recent maintenance is acceptable for your project timeline.

Install

htmldocx on PyPI

pip

pip install htmldocx

uv

uv add htmldocx

poetry

poetry add htmldocx

Installing htmldocx

Before you install

Low friction install with only two runtime dependencies (python-docx and beautifulsoup4). However, the package is dormant—last release was 2021-08-25 and last commit 2024-07-09, so maintenance is minimal despite the repository remaining active.

License in practice

Licensed under MIT (permissive), so you can use, modify, and distribute the package freely with minimal restrictions.

Quickstart

pip install htmldocx

from htmldocx import HtmlToDocx
from docx import Document

parser = HtmlToDocx()
document = Document()
parser.add_html_to_document('<p>Hello world</p>', document)
document.save('output.docx')

Verify before relying

  • HTML feature coverage and limitations (which tags/attributes are supported or ignored)
  • Performance characteristics with large HTML documents
  • Compatibility with recent versions of python-docx and beautifulsoup4

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 2 — python-docx, beautifulsoup4
Maintenance dormant — 1,815 days since the last release
Last repo commit
First released
Downloads 1,202,067/month — #4,229 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: htmldocx-0.0.6-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

html to docx conversionconvert html to word documenthtml parser docxgenerate word documents from htmlhtml to microsoft word
document-generationhtml-conversion

More HTML packages