pyhwp
raw JSON → 0.1b15 verified Sat May 09 auth: no python
A Python library for parsing HWP (Hangul Word Processor) files, a legacy Korean document format. Current version 0.1b15, beta release cadence is irregular.
pip install pyhwp Common errors
error ModuleNotFoundError: No module named 'pyhwp' ↓
cause The package is installed but import path is wrong; users try 'import pyhwp' instead of 'from pyhwp.hwp5 import HWPFile'.
fix
Use correct import: from pyhwp.hwp5 import HWPFile
error AttributeError: module 'pyhwp' has no attribute 'HWPFile' ↓
cause Attempting to import HWPFile from the top-level pyhwp package.
fix
Import from the hwp5 submodule: from pyhwp.hwp5 import HWPFile
Warnings
gotcha The package is in beta (0.1b15); API stability is not guaranteed. Expect breaking changes between versions. ↓
fix Pin to a specific version, e.g., pyhwp==0.1b15
deprecated PyPI name 'pyhwp' may be confused with 'pyhwp' Chinese word processor library, but this is the Korean HWP parser. ↓
fix Install from PyPI with correct case: pip install pyhwp
Imports
- HWPFile wrong
from pyhwp import HWPFilecorrectfrom pyhwp.hwp5 import HWPFile
Quickstart
from pyhwp.hwp5 import HWPFile
import os
hwp_path = os.environ.get('HWP_SAMPLE', 'sample.hwp')
hwp = HWPFile(hwp_path)
print(hwp.to_text())