From easy-hwp
한글 파일(.hwp, .hwpx)의 구조를 분석합니다. "hwp 분석", "서식 분석", "한글 파일 구조" 요청시 사용합니다.
How this skill is triggered — by the user, by Claude, or both
Slash command
/easy-hwp:hwp-analyzeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
$ARGUMENTS
$ARGUMENTS
Windows + 한글 프로그램이 설치된 환경에서는 pyhwpx를 사용합니다.
from pyhwpx import Hwp
hwp = Hwp()
hwp.open("서식.hwp") # .hwp, .hwpx 모두 지원
# 필드 목록 조회
fields = hwp.get_field_list()
print(fields)
# 필드값 조회
for field in fields:
value = hwp.get_field_text(field)
print(f"{field}: {value}")
hwp.quit()
pyhwpx 설치: pip install pyhwpx
HWPX는 ZIP 형식의 압축 파일입니다.
hwpx파일/
├── Contents/
│ ├── section0.xml # 본문 내용 (첫 번째 섹션)
│ ├── section1.xml # 추가 섹션 (있는 경우)
│ └── header.xml # 헤더 정보
├── settings.xml # 문서 설정
└── mimetype # 파일 타입 정보
unzip -o {파일}.hwpx -d {임시디렉토리}/
XML 읽기: Contents/section0.xml 파일을 Read 도구로 읽습니다.
XML 구조 분석
네임스페이스: hp = http://www.hancom.co.kr/hwpml/2011/paragraph
| 태그 | 의미 |
|---|---|
<hp:tbl> | 표 (table) |
<hp:tr> | 행 (table row) |
<hp:tc> | 셀 (table cell) |
<hp:t> | 텍스트 내용 |
<hp:p> | 문단 (paragraph) |
표 구조 예시:
<hp:tbl>
<hp:tr>
<hp:tc><hp:p><hp:t>필드명</hp:t></hp:p></hp:tc>
<hp:tc><hp:p><hp:t>값</hp:t></hp:p></hp:tc>
</hp:tr>
</hp:tbl>
필드 추출: 2열 표에서 첫 번째 열은 필드명, 두 번째 열은 값
임시 파일 정리
rm -rf {임시디렉토리}
/hwp-fill로 채우기).hwp는 지원 안 됨 → 한글에서 .hwpx로 다시 저장하라고 안내.hwp, .hwpx 모두 지원npx claudepluginhub nathankim0/easy-hwp --plugin easy-hwpCreates, edits, reads, and validates HWPX Korean documents via XML extraction from section0.xml/header.xml, Python script assembly, and page drift checks to preserve layout.
Edits, extracts, and automates Korean HWPX/OWPML documents. Handles template placeholder replacement, document creation, and operating plan generation.