--- id: htmldocx version: "0.0.6" license: unclear license_treatment: permissive maintenance: dormant --- # htmldocx — Convert html to docx License: permissive · Maintenance: dormant · Downloads: 1.2M/mo ## 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 above — 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 pip install htmldocx uv add htmldocx 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('

Hello world

', 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_current - Install friction: low - Maintenance: dormant - Downloads: 1.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags html to docx conversion, convert html to word document, html parser docx, generate word documents from html, html to microsoft word, document-generation, html-conversion [View on SkillFed](https://skillfed.io/packages/htmldocx) · [View on PyPI](https://pypi.org/project/htmldocx/)