Python HWP 파일 파서 및 텍스트 추출 라이브러리
Project description
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를 참조하세요.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file helper_hwp-0.5.6.tar.gz.
File metadata
- Download URL: helper_hwp-0.5.6.tar.gz
- Upload date:
- Size: 82.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e72fa1540d5d531a34335e235938ac0d5fc64d28ef3f105fddd1780c816ab69
|
|
| MD5 |
263b8d211a6196e35237d7966019188f
|
|
| BLAKE2b-256 |
a3139d7ac666997efceb708e8b8fe23e2108893647dc39a92ee971709a6b86a3
|
File details
Details for the file helper_hwp-0.5.6-py3-none-any.whl.
File metadata
- Download URL: helper_hwp-0.5.6-py3-none-any.whl
- Upload date:
- Size: 86.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
808637a3539abc6de72fc675bbba8459097d6bc251996010930e831cadd0bda4
|
|
| MD5 |
14e74c456112066f244b28f9d2f4cd2b
|
|
| BLAKE2b-256 |
3d86710628708b402ed623c6ce508b48b4461da162c86a421b9af7dc0ca509ff
|