pdfprep 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdfprep
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: PDF 전처리 통합 도구 — 메타데이터, 텍스트 파싱, OCR, 표 추출
5
5
  Author-email: uwpark <uwpark@simplatform.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pdfprep"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "PDF 전처리 통합 도구 — 메타데이터, 텍스트 파싱, OCR, 표 추출"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -8,7 +8,7 @@ pdfprep — PDF 전처리 도구 모음
8
8
  table : 3종 라이브러리(camelot / tabula / layoutparser)로 표 추출
9
9
  """
10
10
 
11
- __version__ = "0.2.0"
11
+ __version__ = "0.2.1"
12
12
 
13
13
  from . import metadata, parsing, ocr, table
14
14
 
@@ -71,8 +71,18 @@ def ocr_with_paddleocr(pdf_path, lang="korean", dpi=200):
71
71
  PaddleOCR — Baidu의 딥러닝 기반 OCR.
72
72
  검출(detection) + 인식(recognition) 단계를 거쳐 박스 + 텍스트 + 신뢰도 반환.
73
73
  """
74
- import numpy as np
75
- from paddleocr import PaddleOCR
74
+ try:
75
+ import numpy as np
76
+ from paddleocr import PaddleOCR
77
+ except ImportError as e:
78
+ raise RuntimeError(
79
+ "paddleocr 엔진을 사용할 수 없습니다 — paddleocr / paddlepaddle 가 설치되어 있지 않습니다.\n"
80
+ f" 현재 Python {sys.version_info.major}.{sys.version_info.minor} 환경입니다. "
81
+ "paddleocr 2.7.3 / paddlepaddle 2.6.2 는 Python 3.12 이하 휠만 제공하므로 "
82
+ "3.13+ 에서는 설치 대상에서 자동 제외됩니다.\n"
83
+ " → Python 3.12 환경에서 `pip install \"pdfprep[ocr]\"` 로 설치하거나, "
84
+ "tesseract 엔진(engine='tesseract')을 사용하세요."
85
+ ) from e
76
86
 
77
87
  ocr = PaddleOCR(use_angle_cls=True, lang=lang, show_log=False)
78
88
 
@@ -128,7 +128,17 @@ def extract_with_layoutparser(pdf_path, dpi=200, model_name=None):
128
128
  if not hasattr(Image, "CUBIC"):
129
129
  Image.CUBIC = Image.BICUBIC
130
130
 
131
- import layoutparser as lp
131
+ try:
132
+ import layoutparser as lp
133
+ except ImportError as e:
134
+ raise RuntimeError(
135
+ "layoutparser 엔진을 사용할 수 없습니다 — layoutparser 가 설치되어 있지 않습니다.\n"
136
+ f" 현재 Python {sys.version_info.major}.{sys.version_info.minor} 환경입니다. "
137
+ "layoutparser + paddlepaddle 백엔드는 Python 3.12 이하 휠만 제공하므로 "
138
+ "3.13+ 에서는 설치 대상에서 자동 제외됩니다.\n"
139
+ " → Python 3.12 환경에서 `pip install \"pdfprep[table]\"` 로 설치하거나, "
140
+ "camelot / tabula 엔진을 사용하세요."
141
+ ) from e
132
142
 
133
143
  # PaddleDetection 백엔드 + TableBank 모델 (표 전용 학습)
134
144
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdfprep
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: PDF 전처리 통합 도구 — 메타데이터, 텍스트 파싱, OCR, 표 추출
5
5
  Author-email: uwpark <uwpark@simplatform.com>
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes