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.0.tar.gz
(3.1 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
File details
Details for the file litparser-0.5.0.tar.gz.
File metadata
- Download URL: litparser-0.5.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00d1b2b965031b59b0fc29cff946d5050f96456d6966c3ef70bfb1df31e6663a
|
|
| MD5 |
ea0f5b96af93f7f58d3fb521e834f4f3
|
|
| BLAKE2b-256 |
9ff4da7b205dae8f8755c265ad73fa78838eda99794305f15d9dcb3beec9cc40
|
File details
Details for the file litparser-0.5.0-py3-none-any.whl.
File metadata
- Download URL: litparser-0.5.0-py3-none-any.whl
- Upload date:
- Size: 2.5 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 |
bc746ccfbf4456e659f4056660fe8a3770508712fdfdf24c54b6aa8e40cb63ae
|
|
| MD5 |
2b201d95d97b4a8f643adc96a004cf6b
|
|
| BLAKE2b-256 |
01d125214f3a5554e4cc81d5078a8458fc098dd088aa93e49df6918d5ea9855d
|