python-hwpx
Copyright 2025-2026 airmang

This product includes software developed by airmang.
Licensed under the Apache License, Version 2.0.

Clean-room implementation references:

The HWPX repair and recovery tools include behavior ideas independently
reimplemented from public references, without copying source code:

- sakada3/hwp-ops (Apache-2.0): repair-repack behavior for placing the
  mimetype entry first, storing it uncompressed, and running ZIP integrity
  checks.
- chrisryugj/kordoc (MIT): broken HWPX ZIP recovery behavior using Local File
  Header scanning when the central directory is damaged.
- chrisryugj/kordoc (MIT): HWPX form-fill behavior ideas for preserving
  text-node and run structure, including split text-range replacement and empty
  run handling.
- sakada3/hwp-ops (Apache-2.0): split-run placeholder scan/fill behavior
  ideas, charPrIDRef heterogeneity warning, and touched-paragraph layout-cache
  invalidation.
- hancom-io/hwpx-owpml-model (Apache-2.0): C1 coverage promotion structure
  observations for paragraph line segment elements (`linesegarray`, `lineseg`)
  and rendering matrix elements (`transMatrix`, `scaMatrix`, `rotMatrix`) from
  public model headers only.
- hancom-io/hwpx-owpml-model (Apache-2.0): C1b form-control promotion
  structure observations for `edit`, `comboBox`, and button-family controls
  from public model headers only. hwpxlib sample packages were used only as
  structure and roundtrip fixtures.

- OpenBapul/hml-equation-parser (Apache-2.0): HULK-style EqEdit <-> LaTeX token
  mapping, referenced for reader-direction <hp:equation> script rendering and
  for the authoring-direction LaTeX -> EqEdit conversion. The token maps are a
  clean-room re-derivation from the public EqEdit grammar; no source code was
  copied, translated, or vendored.
- chrisryugj/kordoc (MIT): the authoring-direction approach for native
  <hp:equation> generation — the XML shell contract, reserved-word quoting,
  and untrusted-input guards (source-size and recursion-depth caps) were
  referenced as behavior evidence. Clean-room Python implementation; no source
  code was copied, translated, or vendored.

These form-fill and equation references were used as behavior evidence only. The
implementation is a clean-room Python implementation; no source code was
copied, translated, vendored, or linked.

## Optional dependency: latex2mathml

The optional ``preview`` extra depends on roniemartinez/latex2mathml (MIT), used
to convert LaTeX to MathML for the document preview viewer. It is an unmodified
third-party dependency installed via pip; its MIT license travels with the
package.

## Test fixtures: hwpxlib sample corpus

tests/fixtures/hwpxlib_corpus/ contains .hwpx sample files vendored from
neolord0/hwpxlib (https://github.com/neolord0/hwpxlib), licensed Apache-2.0.
Only sample DATA files are vendored; no hwpxlib source code or structure is
copied (clean-room). Pinned ref is recorded in manifest.json.

## Hancom file-format specification attribution

Parts of this project were developed with reference to the publicly
released Hancom file-format documentation (HWP 5.0 / HWPML) and the
public OWPML schema. As required by that documentation:

“본 제품은 한글과컴퓨터의 ᄒᆞᆫ글 문서 파일(.hwp) 공개 문서를 참고하여 개발하였습니다.”

────────────────────────────────────────
DISCLAIMER — HWPX Format

"HWPX" is the document format specified and trademarked by
Hancom Inc. (한글과컴퓨터). This project is an independent,
unofficial implementation and is not affiliated with, endorsed by,
or sponsored by Hancom Inc.
────────────────────────────────────────
