Robert Helewka r

html2msoffice (0.2.0)

Published 2026-08-22 15:14:27 +00:00 by r

Installation

pip install --index-url https://git.helu.ca/api/packages/r/pypi/simple/ --extra-index-url https://pypi.org/simple html2msoffice

About this package

Convert HTML documents to Microsoft Word (.docx), PowerPoint (.pptx) and Excel (.xlsx) files.

html2msoffice

Convert agent-authored HTML into native PowerPoint (.pptx), Word (.docx) and Excel (.xlsx) files, styled by a branded Office template.

# Icons are rasterized with cairosvg, which binds to the *system* cairo
# library at runtime -- pip cannot supply it.
sudo apt install libcairo2        # Debian/Ubuntu
brew install cairo                # macOS

pip install -e .

html2pptx deck.html -o deck.pptx -t NTTDATA_LIGHT.pptx
html2docx doc.html  -o doc.docx  -t NTTDATA_DOCX.docx
html2xlsx book.html -o book.xlsx

Without libcairo, everything still converts — icons and badges are skipped with a warning (no library called "cairo-2" was found). The xlsx renderer never touches cairo at all.

Output is real Office objects — editable text boxes, tables and shapes — not images of a web page. The converter applies no styling of its own: fonts come from the template's theme, colours from the authored CSS.

Start here: docs/html2msoffice.md — architecture, layout engine, charts, and how to work on the code.

Authoring contracts for agents: slides · documents · workbooks · icons

Client decks stay out of this repo. .gitignore blocks working HTML at the repo root; test fixtures live in tests/ and must be generic.

Requirements

Requires Python: >=3.12
Details
PyPI
2026-08-22 15:14:27 +00:00
297
Robert Helewka
MIT License Copyright (c) 2026 r Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
234 KiB
Assets (2)
Versions (2) View all
0.2.0 2026-08-22
0.1.0 2026-07-20