helper_hwp
Python으로 작성된 HWP (한글 문서) 파일 파서 및 텍스트 추출 라이브러리입니다.
특징
- HWP 5.x 포맷 지원 (CFB 기반)
- HWP 97 (V3.00) 포맷 지원
- HWPX / OWPML 포맷 지원
- 파일 포맷 자동 감지 (
open_hwp) - 텍스트 추출 및 마크다운 변환
- PDF 변환 지원 (
to_pdf, playwright 필요) - CLI 명령어 제공:
hwp2txt,hwp2md,hwp2html,hwp2doc,hwp2pdf - 표, 페이지 단위 파싱 지원
- 단위 변환 유틸리티 제공 (HWPUNIT ↔ cm/inch/px)
설치
pip install helper-hwp
또는 소스에서 설치:
git clone https://github.com/c0z0c-helper/helper_hwp.git
cd helper_hwp
pip install -e .
빠른 시작
텍스트 추출
from helper_hwp import to_txt
# HWP / HWP97 / HWPX 포맷 자동 감지
text = to_txt('example.hwp')
print(text)
마크다운 변환
from helper_hwp import to_md
# HWP / HWP97 / HWPX 포맷 자동 감지
markdown = to_md('example.hwp')
print(markdown)
PDF 변환
from helper_hwp import to_pdf
# playwright 설치 필요: pip install playwright && playwright install chromium
to_pdf('example.hwp', 'output.pdf')
문서 객체 사용
from helper_hwp import open_hwp, ElementType
# HWP 문서 열기 (포맷 자동 감지)
with open_hwp('example.hwp') as doc:
for etype, elem in doc.iter_tags():
if etype == ElementType.PARAGRAPH:
print(elem.text)
CLI 사용
hwp2txt example.hwp
hwp2md example.hwp
hwp2pdf example.hwp
Examples
다음 예제를 참고하세요:
또는 소스 배포판(sdist)을 다운로드하여 확인:
pip download --no-deps helper-hwp
tar -xzf helper_hwp-*.tar.gz
문서
요구사항
- Python 3.8 이상
- olefile >= 0.46
- pycryptodome >= 3.15.0
라이센스
이 프로젝트는 Apache License 2.0 라이센스 하에 배포됩니다.
누구나 자유롭게 사용하고 수정할 수 있으며, 사용 시 출처를 표기해 주세요.
출처: https://github.com/c0z0c-helper/helper_hwp
자세한 내용은 LICENSE 파일을 참조하세요.
기여
프로젝트에 대한 기여를 환영합니다! 기여 방법은 개발자 문서를 참조하세요.
변경 이력
변경 이력은 CHANGELOG.md를 참조하세요.
Release files for helper-hwp 0.5.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| helper_hwp-0.5.6.tar.gz | 82.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| helper_hwp-0.5.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:168.3 kB
Release files / helper_hwp-0.5.6.tar.gz
| Download URL | helper_hwp-0.5.6.tar.gz |
|---|---|
| Size | 82.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e72fa1540d5d531a34335e235938ac0d5fc64d28ef3f105fddd1780c816ab69
|
|
BLAKE2b-256 checksum How to use checksums |
a3139d7ac666997efceb708e8b8fe23e2108893647dc39a92ee971709a6b86a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / helper_hwp-0.5.6-py3-none-any.whl
| Download URL | helper_hwp-0.5.6-py3-none-any.whl |
|---|---|
| Size | 86.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
808637a3539abc6de72fc675bbba8459097d6bc251996010930e831cadd0bda4
|
|
BLAKE2b-256 checksum How to use checksums |
3d86710628708b402ed623c6ce508b48b4461da162c86a421b9af7dc0ca509ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|