python-hwpx
한글 없이 HWPX 문서를 열고, 편집하고, 생성하고, 검증하는 Python 문서 라이브러리
What it is and what it does
python-hwpx is a pure-Python library for reading, editing, and creating HWPX documents—the XML-based format used by Hancom Office (Korean word processor). It eliminates the need to install Hancom Office itself, making HWPX manipulation available on any platform where Python runs, including Linux, macOS, Windows, and AI chat environments. The library preserves document formatting and byte-level integrity when editing existing files, and generates new documents that open correctly in Hancom Office.
The package handles common document workflows: extracting text and exporting to HTML or Markdown, editing paragraphs and tables while preserving formatting, filling form templates by label-based cell lookup, generating new documents with styles and structure, and validating document integrity. It includes a safety contract for writes—if a requested preservation level cannot be met, the save fails without writing anything. A mutation report is returned with each save, documenting what changed and what was preserved.
Use it for:
- Automate form filling in HWPX templates by label lookup, preserving formatting and document structure.
- Generate HWPX reports and documents programmatically in CI/CD pipelines without Hancom Office installed.
- Use HWPX documents with AI agents (ChatGPT, Claude) to read, edit, and return documents while preserving formatting.
- Extract text, tables, and metadata from HWPX files for data processing or archival without manual conversion.
- Batch-process multiple HWPX documents on Linux/macOS servers where Hancom Office is unavailable.
- Create mail-merge workflows that populate HWPX templates with data from external sources.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads, edits, and creates HWPX documents (Korean word processor format) in pure Python without requiring Hancom Office, supporting text extraction, form filling, and document generation across Windows, macOS, Linux, and AI environments.
Yes, with conditions. Install if you need to work with HWPX documents in Python without Hancom Office, especially for automation, form filling, or AI integration. The low install friction, active maintenance, and permissive license support this. However, be aware the API is in Alpha and may change; pin the version if stability is critical. The documented test corpus (476+ files) and byte-preservation guarantees provide confidence for production use, but verify compatibility with your specific HWPX variants first.
Install
python-hwpx on PyPI
pip
pip install python-hwpxuv
uv add python-hwpxpoetry
poetry add python-hwpxInstalling python-hwpx
Before you install
Installation is low-friction with a single runtime dependency (lxml). The package is actively maintained with a release just 3 days old and 104 repository stars, though it carries an Alpha development status, meaning the API may change.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions—suitable for most deployment scenarios.
Quickstart
pip install python-hwpx
from hwpx import HwpxDocument
doc = HwpxDocument.new()
doc.add_heading("Title", level=1)
doc.add_paragraph("Content")
doc.save_to_path("output.hwpx")
Requires Python 3.10 or later.
Verify before relying
- Performance characteristics when processing large HWPX files or batch operations.
- Stability of the Alpha API across real-world production workflows beyond the documented test corpus.
- Compatibility with HWPX files created by older versions of Hancom Office.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — lxml |
| Maintenance | actively maintained — 3 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 110,440/month — #12,461 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_hwpx-6.0.3-py3-none-any.whl
Keywords: hwp, hwpx, hancom, opc, xml, document-automation, validation, template
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
pyhwpParses and extracts data from HWP Document…
agpl · top 15,000 on PyPI
pyhwpxAutomates HWP (아래아한글) document creation and…
unclear · top 15,000 on PyPI
docxCreates, reads, and writes Microsoft Office…
unclear · top 15,000 on PyPI
pymupdfproPyMuPDF Pro extends PyMuPDF with commercial…
unclear · top 15,000 on PyPI
aspose-wordsAspose.Words for Python is a document…
unclear · top 15,000 on PyPI
docx2pdfConverts DOCX files to PDF on Windows or macOS…
permissive · top 5,000 on PyPI
docx-mailmerge2Performs mail merge operations on docx files by…
permissive · top 15,000 on PyPI
docx-mailmergePerforms mail merge operations on docx files by…
permissive · top 15,000 on PyPI
spire-docSpire.Doc creates, reads, modifies, and…
unclear · top 15,000 on PyPI
python-evtxParses Windows Event Log files (.evtx) into…
permissive · top 15,000 on PyPI