docling 1.7.0__py3-none-any.whl → 1.7.1__py3-none-any.whl

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.
@@ -23,9 +23,19 @@ class DoclingParsePageBackend(PdfPageBackend):
23
23
  self._ppage = page_obj
24
24
 
25
25
  parsed_page = parser.parse_pdf_from_key_on_page(document_hash, page_no)
26
- self._dpage = parsed_page["pages"][0]
26
+
27
+ self._dpage = None
28
+ self.broken_page = "pages" not in parsed_page
29
+ if not self.broken_page:
30
+ self._dpage = parsed_page["pages"][0]
31
+ else:
32
+ raise RuntimeError(
33
+ f"Page {page_no} of document {document_hash} could not be parsed."
34
+ )
27
35
 
28
36
  def get_text_in_rect(self, bbox: BoundingBox) -> str:
37
+ if self.broken_page:
38
+ return ""
29
39
  # Find intersecting cells on the page
30
40
  text_piece = ""
31
41
  page_size = self.get_size()
@@ -60,6 +70,9 @@ class DoclingParsePageBackend(PdfPageBackend):
60
70
  cells = []
61
71
  cell_counter = 0
62
72
 
73
+ if self.broken_page:
74
+ return cells
75
+
63
76
  page_size = self.get_size()
64
77
 
65
78
  parser_width = self._dpage["width"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: docling
3
- Version: 1.7.0
3
+ Version: 1.7.1
4
4
  Summary: Docling PDF conversion package
5
5
  Home-page: https://github.com/DS4SD/docling
6
6
  License: MIT
@@ -23,7 +23,7 @@ Requires-Dist: certifi (>=2024.7.4)
23
23
  Requires-Dist: deepsearch-glm (>=0.19.0,<1)
24
24
  Requires-Dist: docling-core (>=1.1.2,<2.0.0)
25
25
  Requires-Dist: docling-ibm-models (>=1.1.2,<2.0.0)
26
- Requires-Dist: docling-parse (>=1.0.0,<2.0.0)
26
+ Requires-Dist: docling-parse (>=1.1.1,<2.0.0)
27
27
  Requires-Dist: easyocr (>=1.7,<2.0)
28
28
  Requires-Dist: filetype (>=1.2.0,<2.0.0)
29
29
  Requires-Dist: huggingface_hub (>=0.23,<1)
@@ -1,7 +1,7 @@
1
1
  docling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  docling/backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  docling/backend/abstract_backend.py,sha256=wvrywm1pPt79L5Dt_da5QGmf9dDzjBGj1rSaUQxqI8s,1432
4
- docling/backend/docling_parse_backend.py,sha256=E4JFpWBamiU8vRmHvgMZLU7lOxtUMq85TV5hMrGvWJI,7070
4
+ docling/backend/docling_parse_backend.py,sha256=hXyF2VPPdLs7APWEXTlfz0wI86rUGYa67Q73zgTB-Ug,7438
5
5
  docling/backend/pypdfium2_backend.py,sha256=84AnFah8Ztk-j8_9MTHalPU3a9fClrEz7A_rfzWDkFc,8122
6
6
  docling/datamodel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  docling/datamodel/base_models.py,sha256=5VHit5h7OleKnbhvy-sWDxQLizEdNrGUBrypyzwHyAE,8604
@@ -21,7 +21,7 @@ docling/pipeline/standard_model_pipeline.py,sha256=UTjyaEXvz9htYZz-IMTkn11cZwNjg
21
21
  docling/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  docling/utils/layout_utils.py,sha256=FOFbL0hKzUoWXdZaeUvEtFqKv0IkPifIr4sdGW4suKs,31804
23
23
  docling/utils/utils.py,sha256=llhXSbIDNZ1MHOwBEfLHBAoJIAYI7QlPIonlI1jLUJ0,1208
24
- docling-1.7.0.dist-info/LICENSE,sha256=ACwmltkrXIz5VsEQcrqljq-fat6ZXAMepjXGoe40KtE,1069
25
- docling-1.7.0.dist-info/METADATA,sha256=yqKqPH3w2IxOhmdqHy0nJcYKDrJAufx6uF1Ti44pRs4,7229
26
- docling-1.7.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
27
- docling-1.7.0.dist-info/RECORD,,
24
+ docling-1.7.1.dist-info/LICENSE,sha256=ACwmltkrXIz5VsEQcrqljq-fat6ZXAMepjXGoe40KtE,1069
25
+ docling-1.7.1.dist-info/METADATA,sha256=ADdVabYgc4VEIGKhM-tI6XBU_CG9tzKl_au69TZ9LbY,7229
26
+ docling-1.7.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
27
+ docling-1.7.1.dist-info/RECORD,,