Skip to main content

Multi-format document parser and converter (HWP, HWPX, PDF, Image)

Project description

ureca_document_parser

PyPI version Python 3.12+ License: MIT

한국어 워드프로세서 문서(HWP/HWPX)를 Markdown으로 변환하는 파이썬 라이브러리예요. LangChain과 완벽하게 통합되어 RAG 파이프라인 구축에 최적화되어 있어요.

주요 기능

  • HWP/HWPX 지원 — 아래한글 바이너리(HWP) 및 XML(HWPX) 포맷 모두 파싱
  • 📝 Markdown 변환 — 문단, 표, 리스트, 헤딩을 Markdown으로 변환
  • 🔗 LangChain 통합 — RAG 파이프라인을 위한 문서 청킹 기능 내장
  • 🎯 간단한 API — 한 줄로 변환하는 직관적인 인터페이스
  • 🛠️ CLI 도구 — 커맨드라인에서 바로 사용 가능
  • 🔧 확장 가능 — 새로운 포맷 추가가 쉬운 클린 아키텍처

설치

기본 설치 (HWP/HWPX만)

uv add ureca_document_parser

또는 pip 사용:

pip install ureca_document_parser

LangChain 통합 포함

uv add "ureca_document_parser[langchain]"

빠른 시작

Python API

from ureca_document_parser import convert

# 파일로 저장
convert("보고서.hwp", "보고서.md")

# 문자열로 반환
markdown = convert("보고서.hwp")
print(markdown)

# LangChain 청크로 반환 (RAG용)
chunks = convert("보고서.hwp", chunks=True, chunk_size=1000, chunk_overlap=200)
for chunk in chunks:
    print(chunk.page_content)

CLI

# 파일 변환
uv run ureca_document_parser 보고서.hwp -o 보고서.md

# 표준 출력으로
uv run ureca_document_parser 보고서.hwp

# 여러 파일 일괄 변환
for file in *.hwp; do
    uv run ureca_document_parser "$file" -o "${file%.hwp}.md"
done

LangChain과 함께 사용하기

from ureca_document_parser import convert
from langchain_openai import OpenAIEmbeddings
from langchain_chroma import Chroma

# 문서를 청크로 변환
chunks = convert("보고서.hwp", chunks=True)

# 벡터 스토어에 저장
embeddings = OpenAIEmbeddings()
vectorstore = Chroma.from_documents(documents=chunks, embedding=embeddings)

# 검색
results = vectorstore.similarity_search("프로젝트 일정은?", k=3)

지원 포맷

포맷 확장자 설명
HWP .hwp 아래한글 바이너리 포맷 (v5.0+)
HWPX .hwpx 아래한글 XML 포맷 (2014+)

문서

자세한 사용법과 API 문서는 공식 문서를 참고하세요:

제한사항

현재 버전에서는 다음 기능을 지원하지 않아요:

  • 이미지 추출 (대체 텍스트만 표시)
  • 도형 및 차트
  • 머리글/바닥글
  • 각주/미주
  • 복잡한 표 병합 구조

개발

# 개발 환경 설정
git clone https://github.com/ureca-corp/document_parser.git
cd document_parser
uv sync --extra dev

# 테스트 실행
uv run pytest tests/ -v

# 문서 미리보기
uv sync --extra docs
uv run mkdocs serve

라이선스

MIT License - 자세한 내용은 LICENSE 파일을 참고하세요.

기여

기여는 언제나 환영이에요! 이슈를 통해 버그 리포트나 기능 제안을 해주세요.

링크

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

ureca_document_parser-0.0.2.tar.gz (188.4 kB view details)

Uploaded Source

Built Distribution

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

ureca_document_parser-0.0.2-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file ureca_document_parser-0.0.2.tar.gz.

File metadata

  • Download URL: ureca_document_parser-0.0.2.tar.gz
  • Upload date:
  • Size: 188.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ureca_document_parser-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b76d5420c3c10a9f97cbcbaa065047d4f62d9580a60c32af44b0d8053c95931d
MD5 b27aa748bc6309fa09828a4ebeac9546
BLAKE2b-256 e6c39f198fe49ec61ff2020305d9c25b41ccd393997088ffacb8a384c5e30c1d

See more details on using hashes here.

File details

Details for the file ureca_document_parser-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ureca_document_parser-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ureca_document_parser-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6f8b1497de1ba69e2bd207f72c77c7681ffe7745aa1306517e7a92f58c6d005e
MD5 828c2695d1c76a521afd35e32d0eb22d
BLAKE2b-256 ca235fda84b25c71801676af9a236f3b3b74528b9d7fa9f92786cb22afe16b21

See more details on using hashes here.

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