Lightweight Document Parser - 순수 Python으로 PDF, DOCX, PPTX, HWPX 파싱
Project description
LitParser
Liteweight Document Parser - 순수 Python으로 구현된 문서 파서.
외부 라이브러리 없이 PDF, DOCX, PPTX, HWPX 파일을 파싱합니다.
특징
- ✅ Zero Dependencies - 표준 라이브러리만 사용
- ✅ 다양한 포맷 - PDF, DOCX, PPTX, HWPX, TXT, MD
- ✅ 텍스트 추출 - 위치 정보 포함
- ✅ 테이블 감지 - 마크다운 변환
- ✅ 이미지 추출 - PNG, JPEG, JP2
- ✅ 출력 포맷 - Markdown, JSON
설치
pip install litparser
소스에서:
pip install -e .
CLI
# 텍스트 추출
litparser document.pdf
litparser report.docx
# 마크다운 변환
litparser document.pdf --markdown
litparser document.pdf --md -o result.md
# JSON 변환
litparser document.pdf --json
litparser document.pdf --json --include-images
# 테이블
litparser document.pdf --tables
# 분석
litparser document.pdf --analyze
Python API
from litparser import parse_pdf, extract_text, extract_tables
# PDF 파싱
doc = parse_pdf('document.pdf')
# 텍스트
text = extract_text(doc, page_num=0)
# 테이블
tables = extract_tables(doc, page_num=0)
for t in tables:
print(t.to_markdown())
# 마크다운/JSON 변환
from litparser.output_formatter import pdf_to_output, to_markdown, to_json
output = pdf_to_output(doc)
md = to_markdown(output)
json_str = to_json(output)
지원 포맷
| 포맷 | 확장자 | 텍스트 | 테이블 | 이미지 |
|---|---|---|---|---|
| ✅ | ✅ | ✅ | ||
| Word | .docx | ✅ | ✅ | ✅ |
| PowerPoint | .pptx | ✅ | ✅ | ✅ |
| 한글 | .hwpx | ✅ | ✅ | ✅ |
| 텍스트 | .txt, .md | ✅ | - | - |
라이선스
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
litparser-0.5.1.tar.gz
(56.3 kB
view details)
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
litparser-0.5.1-py3-none-any.whl
(66.6 kB
view details)
File details
Details for the file litparser-0.5.1.tar.gz.
File metadata
- Download URL: litparser-0.5.1.tar.gz
- Upload date:
- Size: 56.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
629237ae6648d8504f7ebbd2616ab152ee8f2fe22aba3e2395631fa09990ed1e
|
|
| MD5 |
a9395bc689ecd7d0ae7a9dab1ec2e01b
|
|
| BLAKE2b-256 |
6dc53ecfd6563fffabd5a0bbab1344f29c714d4ac4e8620c1f3e2109ff3e8f76
|
File details
Details for the file litparser-0.5.1-py3-none-any.whl.
File metadata
- Download URL: litparser-0.5.1-py3-none-any.whl
- Upload date:
- Size: 66.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fba1a5c5ab5c6a8067e35c04bfd7d89d027dc1ee348855735229b5efc8afc01e
|
|
| MD5 |
dcf3275d82dabd1771b3e49654738003
|
|
| BLAKE2b-256 |
5cf4d8b8a927d0e09baea41020b688f7f0c5fd02b8d202e7b9c5e00d4c445009
|