How airmang/python-hwpx works
python-hwpx is a pure-Python library for reading, editing, creating, and validating HWPX documents, with HWP 5.0 conversion support. The main workflow is to open or create a document, edit its content or structure, then save it; optional patch saving preserves untouched package parts. The graph also shows major documented capabilities—form filling, extraction, layout, equations, and batch tools—and the internal OXML and OPC layers. Some subsystem links are based on README capability descriptions because their source was not sampled; those links are dashed and unverified.
Main entry points: document.py Document API · save_pipeline.py Safe save gate · section.py Sections and stories · engine.py Form fitting
Components 23
Document API
- Document API
src/hwpx/document.py
Content and Layout
- Paragraph editing
src/hwpx/oxml/paragraph.py - Table editing
src/hwpx/oxml/table.py - Sections and stories
src/hwpx/oxml/section.py - Page formatting
src/hwpx/oxml/section_format.py - Form fitting
src/hwpx/form_fit/engine.py - Text measurement
src/hwpx/form_fit/measure.py - Equation authoring
src/hwpx/equation/authoring.py - Page layout
src/hwpx/layout/pages.py
Format Handling
- OXML model
src/hwpx/oxml/document.py - XML primitives
src/hwpx/oxml/_document_primitives.py - OPC package
src/hwpx/opc/package.py - HWP5 reader
src/hwpx/hwp5/reader.py - HWP5 writer
src/hwpx/hwp5/writer.py
Validation and Safety
- Package validation
src/hwpx/tools/package_validator.py - Safe save gate
src/hwpx/quality/save_pipeline.py - Package security
src/hwpx/opc/security.py - Save report
src/hwpx/quality/report.py
Document Tools
- Text extraction
src/hwpx/tools/text_extractor.py - Document export
src/hwpx/tools/exporter.py - Mail merge
src/hwpx/tools/mail_merge.py - TOC authoring
src/hwpx/tools/toc_author.py
Other components
- Python caller
Connections 24
- Python caller → Document API: opens or creates
README.md - Document API → OXML model: edits document
- OXML model → XML primitives: uses primitives
src/hwpx/oxml/_document_primitives.py - Document API → OPC package: loads and saves
src/hwpx/document.py - Document API → Paragraph editing: edits paragraphs
- Document API → Table editing: edits tables
- Document API → Sections and stories: manages sections
- Sections and stories → Page formatting: configures pages
src/hwpx/oxml/section.py - Document API → Form fitting: fills form fields
- Form fitting → Text measurement: measures slots
src/hwpx/form_fit/engine.py - Python caller → Equation authoring: authors equations
README.md - Python caller → Page layout: requests layout
README.md - Python caller → Text extraction: extracts text
README.md - Python caller → Document export: exports formats
README.md - Python caller → Mail merge: runs mail merge
README.md - Python caller → TOC authoring: authors contents
README.md - Python caller → HWP5 reader: opens HWP5
README.md - HWP5 reader → Document API: converts to model
- Document API → HWP5 writer: saves HWP5
README.md - Python caller → Safe save gate: requests safe save
README.md - Safe save gate → Package validation: validates package
src/hwpx/quality/save_pipeline.py - Safe save gate → Package security: checks safety
src/hwpx/quality/save_pipeline.py - Safe save gate → Save report: composes report
src/hwpx/quality/save_pipeline.py - Safe save gate → OPC package: publishes bytes