docling-core 2.13.1__py3-none-any.whl → 2.14.0__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.

Potentially problematic release.


This version of docling-core might be problematic. Click here for more details.

@@ -81,7 +81,7 @@ class BoundingBox(BaseModel):
81
81
 
82
82
  return out_bbox
83
83
 
84
- def as_tuple(self):
84
+ def as_tuple(self) -> Tuple[float, float, float, float]:
85
85
  """as_tuple."""
86
86
  if self.coord_origin == CoordOrigin.TOPLEFT:
87
87
  return (self.l, self.t, self.r, self.b)
@@ -143,7 +143,7 @@ class BoundingBox(BaseModel):
143
143
 
144
144
  return width * height
145
145
 
146
- def to_bottom_left_origin(self, page_height) -> "BoundingBox":
146
+ def to_bottom_left_origin(self, page_height: float) -> "BoundingBox":
147
147
  """to_bottom_left_origin.
148
148
 
149
149
  :param page_height:
@@ -160,7 +160,7 @@ class BoundingBox(BaseModel):
160
160
  coord_origin=CoordOrigin.BOTTOMLEFT,
161
161
  )
162
162
 
163
- def to_top_left_origin(self, page_height):
163
+ def to_top_left_origin(self, page_height: float) -> "BoundingBox":
164
164
  """to_top_left_origin.
165
165
 
166
166
  :param page_height:
@@ -1710,7 +1710,7 @@ class DoclingDocument(BaseModel):
1710
1710
 
1711
1711
  :param root: Optional[NodeItem]: (Default value = None)
1712
1712
  :param with_groups: bool: (Default value = False)
1713
- :param traverse_pictures: bool: (Default value = True)
1713
+ :param traverse_pictures: bool: (Default value = False)
1714
1714
  :param page_no: Optional[int]: (Default value = None)
1715
1715
  :param _level: (Default value = 0)
1716
1716
  :param # fixed parameter:
@@ -81,6 +81,52 @@ class GroupLabel(str, Enum):
81
81
  return str(self.value)
82
82
 
83
83
 
84
+ class PictureClassificationLabel(str, Enum):
85
+ """PictureClassificationLabel."""
86
+
87
+ OTHER = "other"
88
+
89
+ # If more than one picture is grouped together, it
90
+ # is generally not possible to assign a label
91
+ PICTURE_GROUP = "picture_group"
92
+
93
+ # General
94
+ PIE_CHART = "pie_chart"
95
+ BAR_CHART = "bar_chart"
96
+ LINE_CHART = "line_chart"
97
+ FLOW_CHART = "flow_chart"
98
+ SCATTER_CHART = "scatter_chart"
99
+ HEATMAP = "heatmap"
100
+ REMOTE_SENSING = "remote_sensing"
101
+
102
+ NATURAL_IMAGE = "natural_image"
103
+
104
+ # Chemistry
105
+ MOLECULAR_STRUCTURE = "chemistry_molecular_structure"
106
+ MARKUSH_STRUCTURE = "chemistry_markush_structure"
107
+
108
+ # Company
109
+ ICON = "icon"
110
+ LOGO = "logo"
111
+ SIGNATURE = "signature"
112
+ STAMP = "stamp"
113
+ QR_CODE = "qr_code"
114
+ BAR_CODE = "bat_code"
115
+ SCREENSHOT = "screenshot"
116
+
117
+ # Geology/Geography
118
+ GEOGRAPHIC_MAP = "map"
119
+ STRATIGRAPHIC_CHART = "stratigraphic_chart"
120
+
121
+ # Engineering
122
+ CAD_DRAWING = "cad_drawing"
123
+ ELECTRICAL_DIAGRAM = "electrical_diagram"
124
+
125
+ def __str__(self):
126
+ """Get string value."""
127
+ return str(self.value)
128
+
129
+
84
130
  class TableCellLabel(str, Enum):
85
131
  """TableCellLabel."""
86
132
 
@@ -6,9 +6,7 @@
6
6
  """Tokens used in the docling document model."""
7
7
 
8
8
  from enum import Enum
9
- from typing import Annotated, Tuple
10
-
11
- from pydantic import Field
9
+ from typing import Tuple
12
10
 
13
11
 
14
12
  class TableToken(Enum):
@@ -169,8 +167,7 @@ class DocumentToken(Enum):
169
167
 
170
168
  @staticmethod
171
169
  def get_location(
172
- # bbox: Tuple[float, float, float, float],
173
- bbox: Annotated[list[float], Field(min_length=4, max_length=4)],
170
+ bbox: tuple[float, float, float, float],
174
171
  page_w: float,
175
172
  page_h: float,
176
173
  xsize: int = 100,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: docling-core
3
- Version: 2.13.1
3
+ Version: 2.14.0
4
4
  Summary: A python library to define and validate data types in Docling.
5
5
  Home-page: https://ds4sd.github.io/
6
6
  License: MIT
@@ -23,10 +23,10 @@ docling_core/transforms/chunker/hybrid_chunker.py,sha256=9bGhjr4vzpXbOMLCydCl81r
23
23
  docling_core/types/__init__.py,sha256=MVRSgsk5focwGyAplh_TRR3dEecIXpd98g_u3zZ5HXo,260
24
24
  docling_core/types/base.py,sha256=PusJskRVL19y-hq0BgXr5e8--QEqSqLnFNJ8UbOqW88,8318
25
25
  docling_core/types/doc/__init__.py,sha256=bEL4zKVOG7Wxm6xQrgF58mu-Teds9aSavuEAKVNhrTU,639
26
- docling_core/types/doc/base.py,sha256=_ttU8QI8wXDTQRUnN5n7L6D9wYFVLSAibxlFoMbgAsk,4557
27
- docling_core/types/doc/document.py,sha256=ZHQBozH4-85p0YNBjzpTFURmTOenUrOwRyNr67shVcs,91865
28
- docling_core/types/doc/labels.py,sha256=7fzopzvUhnSUalKumQvxSUCutbvEh9aUIKvJ1WKA_lU,2888
29
- docling_core/types/doc/tokens.py,sha256=uU_MYW_p7ypf7eYICFBvxdnVaPZ7CQnvZmbJ6oPrtEA,6134
26
+ docling_core/types/doc/base.py,sha256=7CQ6WyTk2WOznYJ4tRNeJEBIhIUzoKJJkJZabY_GDWc,4625
27
+ docling_core/types/doc/document.py,sha256=WTnEQ3LsuHHx7EvtfFUG7X22Gn7YCYHKLaN3ZldlAss,91866
28
+ docling_core/types/doc/labels.py,sha256=bY_8N4mQJAM0NS2BxQdDTawd7rGocL0i57SQKMSchjE,3994
29
+ docling_core/types/doc/tokens.py,sha256=GMtm5TsNljBPaMYkgmD3WWZmC0FHqKF9imKEEySz4ps,6020
30
30
  docling_core/types/doc/utils.py,sha256=YDOh_ZD1Y7OmCEDdCLJ_MO5K3HA67nc_acfhOK6WztU,1439
31
31
  docling_core/types/gen/__init__.py,sha256=C6TuCfvpSnSL5XDOFMcYHUY2-i08vvfOGRcdu6Af0pI,124
32
32
  docling_core/types/gen/generic.py,sha256=l4CZ4_Lb8ONG36WNJWbKX5hGKvTh_yU-hXp5hsm7uVU,844
@@ -56,8 +56,8 @@ docling_core/utils/generate_jsonschema.py,sha256=uNX1O5XnjyB5nA66XqZXTt3YbGuR2ty
56
56
  docling_core/utils/legacy.py,sha256=xfp7U0JqjI60K3loWiNTk8w08_KfCUzTb2MNULBOIz4,24396
57
57
  docling_core/utils/validate.py,sha256=aQ11UbFyl8iD_N7yTTZmm_VVeXz8KcCyn3GLXgkfYRM,2049
58
58
  docling_core/utils/validators.py,sha256=azcrndLzhNkTWnbFSu9shJ5D3j_znnLrIFA5R8hzmGU,2798
59
- docling_core-2.13.1.dist-info/LICENSE,sha256=2M9-6EoQ1sxFztTOkXGAtwUDJvnWaAHdB9BYWVwGkIw,1087
60
- docling_core-2.13.1.dist-info/METADATA,sha256=xKJXvKHpi2TIOxxghWq6wxlg-U7QcAoF9WPZ1U0c0EU,5744
61
- docling_core-2.13.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
62
- docling_core-2.13.1.dist-info/entry_points.txt,sha256=oClcdb2L2RKx4jdqUykY16Kum_f0_whwWhGzIodyidc,216
63
- docling_core-2.13.1.dist-info/RECORD,,
59
+ docling_core-2.14.0.dist-info/LICENSE,sha256=2M9-6EoQ1sxFztTOkXGAtwUDJvnWaAHdB9BYWVwGkIw,1087
60
+ docling_core-2.14.0.dist-info/METADATA,sha256=Gsg9J6z2VaGEHcGKjMJ7Zu6Tm0easUp056HIbUbx-bc,5744
61
+ docling_core-2.14.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
62
+ docling_core-2.14.0.dist-info/entry_points.txt,sha256=oClcdb2L2RKx4jdqUykY16Kum_f0_whwWhGzIodyidc,216
63
+ docling_core-2.14.0.dist-info/RECORD,,