docling 1.7.0__tar.gz → 1.7.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.
Files changed (27) hide show
  1. {docling-1.7.0 → docling-1.7.1}/PKG-INFO +2 -2
  2. {docling-1.7.0 → docling-1.7.1}/docling/backend/docling_parse_backend.py +14 -1
  3. {docling-1.7.0 → docling-1.7.1}/pyproject.toml +2 -2
  4. {docling-1.7.0 → docling-1.7.1}/LICENSE +0 -0
  5. {docling-1.7.0 → docling-1.7.1}/README.md +0 -0
  6. {docling-1.7.0 → docling-1.7.1}/docling/__init__.py +0 -0
  7. {docling-1.7.0 → docling-1.7.1}/docling/backend/__init__.py +0 -0
  8. {docling-1.7.0 → docling-1.7.1}/docling/backend/abstract_backend.py +0 -0
  9. {docling-1.7.0 → docling-1.7.1}/docling/backend/pypdfium2_backend.py +0 -0
  10. {docling-1.7.0 → docling-1.7.1}/docling/datamodel/__init__.py +0 -0
  11. {docling-1.7.0 → docling-1.7.1}/docling/datamodel/base_models.py +0 -0
  12. {docling-1.7.0 → docling-1.7.1}/docling/datamodel/document.py +0 -0
  13. {docling-1.7.0 → docling-1.7.1}/docling/datamodel/settings.py +0 -0
  14. {docling-1.7.0 → docling-1.7.1}/docling/document_converter.py +0 -0
  15. {docling-1.7.0 → docling-1.7.1}/docling/models/__init__.py +0 -0
  16. {docling-1.7.0 → docling-1.7.1}/docling/models/base_ocr_model.py +0 -0
  17. {docling-1.7.0 → docling-1.7.1}/docling/models/ds_glm_model.py +0 -0
  18. {docling-1.7.0 → docling-1.7.1}/docling/models/easyocr_model.py +0 -0
  19. {docling-1.7.0 → docling-1.7.1}/docling/models/layout_model.py +0 -0
  20. {docling-1.7.0 → docling-1.7.1}/docling/models/page_assemble_model.py +0 -0
  21. {docling-1.7.0 → docling-1.7.1}/docling/models/table_structure_model.py +0 -0
  22. {docling-1.7.0 → docling-1.7.1}/docling/pipeline/__init__.py +0 -0
  23. {docling-1.7.0 → docling-1.7.1}/docling/pipeline/base_model_pipeline.py +0 -0
  24. {docling-1.7.0 → docling-1.7.1}/docling/pipeline/standard_model_pipeline.py +0 -0
  25. {docling-1.7.0 → docling-1.7.1}/docling/utils/__init__.py +0 -0
  26. {docling-1.7.0 → docling-1.7.1}/docling/utils/layout_utils.py +0 -0
  27. {docling-1.7.0 → docling-1.7.1}/docling/utils/utils.py +0 -0
@@ -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)
@@ -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
  [tool.poetry]
2
2
  name = "docling"
3
- version = "1.7.0" # DO NOT EDIT, updated automatically
3
+ version = "1.7.1" # DO NOT EDIT, updated automatically
4
4
  description = "Docling PDF conversion package"
5
5
  authors = ["Christoph Auer <cau@zurich.ibm.com>", "Michele Dolfi <dol@zurich.ibm.com>", "Maxim Lysak <mly@zurich.ibm.com>", "Nikos Livathinos <nli@zurich.ibm.com>", "Ahmed Nassar <ahn@zurich.ibm.com>", "Peter Staar <taa@zurich.ibm.com>"]
6
6
  license = "MIT"
@@ -32,7 +32,7 @@ pydantic-settings = "^2.3.0"
32
32
  huggingface_hub = ">=0.23,<1"
33
33
  requests = "^2.32.3"
34
34
  easyocr = "^1.7"
35
- docling-parse = "^1.0.0"
35
+ docling-parse = "^1.1.1"
36
36
  certifi = ">=2024.7.4"
37
37
  rtree = "^1.3.0"
38
38
  scipy = "^1.14.1"
File without changes
File without changes
File without changes
File without changes