pgx-docling-parser-core 0.1.18__tar.gz → 0.2.0__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
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: pgx-docling-parser-core
3
- Version: 0.1.18
3
+ Version: 0.2.0
4
4
  Summary: Core classes for paperless-docling-parser
5
5
  Project-URL: Homepage, https://github.com/T-Eberle/paperless-docling-parser
6
6
  Project-URL: Issues, https://github.com/T-Eberle/paperless-docling-parser/issues
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Topic :: Communications :: Email
18
18
  Classifier: Topic :: Office/Business
19
19
  Requires-Python: <3.14,>=3.10
20
- Requires-Dist: docling-core>=2.0.0
20
+ Requires-Dist: docling>=2.156.0
21
21
  Requires-Dist: pillow>=10.0.0
22
22
  Requires-Dist: pymupdf>=1.23.0
23
23
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pgx-docling-parser-core"
7
- version = "0.1.18"
7
+ version = "0.2.0"
8
8
  description = "Core classes for paperless-docling-parser"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10,<3.14"
@@ -29,8 +29,8 @@ classifiers = [
29
29
  # Core dependencies needed by both local and docling_serve
30
30
  dependencies = [
31
31
  "pymupdf>=1.23.0",
32
- "docling-core>=2.0.0",
33
32
  "Pillow>=10.0.0",
33
+ "docling>=2.156.0",
34
34
  ]
35
35
 
36
36
  [project.urls]
@@ -12,6 +12,7 @@ class PdfConversionMode(Enum):
12
12
  EASYOCR = "easyocr"
13
13
  TESSERACT = "tesseract"
14
14
  GRANITE_DOCLING = "granite_docling"
15
+ GRANITE_DOCLING_V2 = "granite_docling_v2"
15
16
 
16
17
 
17
18
  def get_pdf_conversion_mode() -> PdfConversionMode:
@@ -46,6 +47,8 @@ class BaseDoclingConverter(ABC):
46
47
  doc = self.convert_tesseract(document_path)
47
48
  elif self.pdf_conversion_mode == PdfConversionMode.GRANITE_DOCLING:
48
49
  doc = self.convert_granite_docling(document_path)
50
+ elif self.pdf_conversion_mode == PdfConversionMode.GRANITE_DOCLING_V2:
51
+ doc = self.convert_granite_docling_v2(document_path)
49
52
  return doc
50
53
 
51
54
  def ocr_language(self) -> list[str]:
@@ -55,10 +58,10 @@ class BaseDoclingConverter(ABC):
55
58
  Returns:
56
59
  list[str]: List of language codes, defaults to ['eng'] if not set.
57
60
 
58
- Example:
59
- PAPERLESS_DOCLING_OCR_LANGUAGE="eng,deu,fra" -> ['eng', 'deu', 'fra']
61
+ Example (easyocr): PAPERLESS_DOCLING_OCR_LANGUAGE="en,de,fr"
62
+ Example (tesseract): PAPERLESS_DOCLING_OCR_LANGUAGE="eng,deu,fra"
60
63
  """
61
- env_value = os.environ.get(PAPERLESS_DOCLING_OCR_LANGUAGE, "eng")
64
+ env_value = os.environ.get(PAPERLESS_DOCLING_OCR_LANGUAGE, "en")
62
65
 
63
66
  # Split by comma and strip whitespace from each language code
64
67
  languages = [lang.strip() for lang in env_value.split(",") if lang.strip()]
@@ -79,6 +82,10 @@ class BaseDoclingConverter(ABC):
79
82
  @abstractmethod
80
83
  def convert_granite_docling(self, document_path: Path) -> DoclingDocument:
81
84
  pass
85
+
86
+ @abstractmethod
87
+ def convert_granite_docling_v2(self, document_path: Path) -> DoclingDocument:
88
+ pass
82
89
 
83
90
 
84
91