Skip to main content

Pure-Python reader for Korean HWP 5.x and HWPX documents — text and tables. Clean-room, permissively licensed.

Project description

syhwp

Pure-Python reader for Korean HWP 5.x and HWPX documents — extracts text and tables, with no external services and a permissive license.

import syhwp

# convenience
text = syhwp.extract_text("report.hwp")        # plain text
md   = syhwp.extract_markdown("report.hwpx")   # GFM markdown (tables as pipe tables)

# structured access
doc = syhwp.open("report.hwp")                 # -> Document
for table in doc.tables:                       # Table: n_rows, n_cols, cells[...]
    print(table.to_markdown())
for para in doc.paragraphs:                     # Paragraph: text
    print(para.text)

Format (HWP vs HWPX) is auto-detected. Works the same for .hwp and .hwpx.

Also available as a command line tool:

syhwp report.hwp                 # markdown (default); also --text / --html
python -m syhwp report.hwpx

Why

The existing Python options each have a blocking flaw for use in commercial or SaaS software:

Library License Issue
pyhwp AGPL-3.0 Strong network copyleft — unusable in closed/SaaS products
libhwp (hwp-rs) Apache-2.0 Unmaintained (0.2.0), panics on real files, no 3.12+ wheels
pyhwpx Windows-only (COM automation)

syhwp fills the gap: pure Python, permissive (MIT), maintained, robust by design (unknown/edge records are skipped rather than crashing).

Install

pip install syhwp

Only dependency: olefile (BSD). HWPX parsing uses the standard library only.

Status

Alpha. See DESIGN.md for the architecture and roadmap.

  • HWP 5.x — text and table extraction (tables reconstructed into GFM pipe tables); equations surfaced as their script, images/drawings as [그림]; document version exposed on Document.version.
  • HWPX — text and table extraction.
  • Robust by design: unknown records are skipped, and malformed / corrupt files raise a SyhwpError subclass rather than crashing (fuzz-tested).
  • Password-protected / distribution (copy-protected) documents raise EncryptedDocumentError (their body streams are encrypted and cannot be read).

Provenance / license note

syhwp is a clean-room implementation written from the publicly published HANCOM HWP 5.0 binary format and OWPML (HWPX) specifications. It does not derive from, or incorporate code from, the AGPL-licensed pyhwp. This is what allows syhwp to be offered under the permissive MIT license.

License

MIT © 2026 sysphere

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

syhwp-0.0.5.tar.gz (30.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

syhwp-0.0.5-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file syhwp-0.0.5.tar.gz.

File metadata

  • Download URL: syhwp-0.0.5.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for syhwp-0.0.5.tar.gz
Algorithm Hash digest
SHA256 4d6721ec4822f349c2cbb958bee4ca4246437cdbcc03bbe40c6fd88d22c4dfdc
MD5 96207d56e1df6f31ae42ad986f218e11
BLAKE2b-256 2614df4c80d61d5b197a927b0b38fa64b2d97f66ca7a765e8767869dec6d5f8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for syhwp-0.0.5.tar.gz:

Publisher: publish.yml on sysphere/syhwp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file syhwp-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: syhwp-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for syhwp-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a66d8f4d97d5784f352c1cb6c953fa49540109241cf4e759c39c1c0878502aae
MD5 fb11beab0f767c773a32d6b49717f592
BLAKE2b-256 94e5e4bcead2977637756734f6c01deb5a93f5028e2a649bcbb8cd41f90cb896

See more details on using hashes here.

Provenance

The following attestation bundles were made for syhwp-0.0.5-py3-none-any.whl:

Publisher: publish.yml on sysphere/syhwp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page