docling-core 2.30.0__py3-none-any.whl → 2.30.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.

Potentially problematic release.


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

@@ -25,6 +25,8 @@ class DocItemLabel(str, Enum):
25
25
  CHECKBOX_UNSELECTED = "checkbox_unselected"
26
26
  FORM = "form"
27
27
  KEY_VALUE_REGION = "key_value_region"
28
+ GRADING_SCALE = "grading_scale" # for elements in forms, questionaires representing a grading scale
29
+ # e.g. [strongly disagree | ... | ... | strongly agree]
28
30
 
29
31
  # Additional labels for markup-based formats (e.g. HTML, Word)
30
32
  PARAGRAPH = "paragraph"
@@ -144,17 +146,43 @@ class TableCellLabel(str, Enum):
144
146
  """Get string value."""
145
147
  return str(self.value)
146
148
 
149
+ @staticmethod
150
+ def get_color(label: "TableCellLabel") -> Tuple[int, int, int]:
151
+ """Return the RGB color associated with a given label."""
152
+ color_map = {
153
+ TableCellLabel.COLUMN_HEADER: (255, 0, 0),
154
+ TableCellLabel.ROW_HEADER: (0, 255, 0),
155
+ TableCellLabel.ROW_SECTION: (0, 0, 255),
156
+ TableCellLabel.BODY: (0, 255, 255),
157
+ }
158
+ return color_map.get(label, (0, 0, 0))
159
+
147
160
 
148
161
  class GraphCellLabel(str, Enum):
149
162
  """GraphCellLabel."""
150
163
 
151
164
  UNSPECIFIED = "unspecified"
152
165
 
153
- KEY = "key"
154
- VALUE = "value"
155
-
166
+ KEY = "key" # used to designate a key (label) of a key-value element
167
+ VALUE = "value" # Data value with or without explicit Key, but filled in,
168
+ # e.g. telephone number, address, quantity, name, date
169
+ EMPTY_VALUE = "empty_value" # used for empty value fields in fillable forms
156
170
  CHECKBOX = "checkbox"
157
171
 
172
+ def __str__(self):
173
+ """Get string value."""
174
+ return str(self.value)
175
+
176
+ @staticmethod
177
+ def get_color(label: "GraphCellLabel") -> Tuple[int, int, int]:
178
+ """Return the RGB color associated with a given label."""
179
+ color_map = {
180
+ GraphCellLabel.KEY: (255, 0, 0),
181
+ GraphCellLabel.VALUE: (0, 255, 0),
182
+ GraphCellLabel.EMPTY_VALUE: (0, 0, 255),
183
+ }
184
+ return color_map.get(label, (0, 0, 0))
185
+
158
186
 
159
187
  class GraphLinkLabel(str, Enum):
160
188
  """GraphLinkLabel."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: docling-core
3
- Version: 2.30.0
3
+ Version: 2.30.1
4
4
  Summary: A python library to define and validate data types in Docling.
5
5
  Home-page: https://github.com/docling-project
6
6
  License: MIT
@@ -41,7 +41,7 @@ docling_core/types/base.py,sha256=PusJskRVL19y-hq0BgXr5e8--QEqSqLnFNJ8UbOqW88,83
41
41
  docling_core/types/doc/__init__.py,sha256=bysJn2iwjAHwThSWDPXEdVUUij7p_ax12_nx2_0CMdg,653
42
42
  docling_core/types/doc/base.py,sha256=sM3IyFXzVh2WT8IGh5nejXYh8sf39yBh8TBSlHeJ9CI,12611
43
43
  docling_core/types/doc/document.py,sha256=eboNYL-QVnDNnw3vL7PPVdPosfs5oNfsrVofxmdBDHw,140884
44
- docling_core/types/doc/labels.py,sha256=xyrQC89OfedBaBvulXtgIGgN3Sv0D4J5k0qSXnGw2hk,5846
44
+ docling_core/types/doc/labels.py,sha256=vp4h3e7AmBvezRmgrfuPehjAHTZOufphErLB4ENhdME,7171
45
45
  docling_core/types/doc/page.py,sha256=1JMPwglaTITBvg959L_pcWPb-fXoDYGh-e_tGZMzVMQ,41060
46
46
  docling_core/types/doc/tokens.py,sha256=z22l9J81_sg9CYMvOuLmPuLsNT7h_s7wao2UT89DvI8,9278
47
47
  docling_core/types/doc/utils.py,sha256=SaiQD-WMMooFm1bMqwatU-IGhtG048iKJb-ppnJit_k,2250
@@ -73,8 +73,8 @@ docling_core/utils/generate_jsonschema.py,sha256=uNX1O5XnjyB5nA66XqZXTt3YbGuR2ty
73
73
  docling_core/utils/legacy.py,sha256=DrI3QGoL755ZCIoKHF74-pTWm8R0zfFo2C2vB5dT2aY,24463
74
74
  docling_core/utils/validate.py,sha256=aQ11UbFyl8iD_N7yTTZmm_VVeXz8KcCyn3GLXgkfYRM,2049
75
75
  docling_core/utils/validators.py,sha256=azcrndLzhNkTWnbFSu9shJ5D3j_znnLrIFA5R8hzmGU,2798
76
- docling_core-2.30.0.dist-info/LICENSE,sha256=2M9-6EoQ1sxFztTOkXGAtwUDJvnWaAHdB9BYWVwGkIw,1087
77
- docling_core-2.30.0.dist-info/METADATA,sha256=mzObLyfGYJ-ZLvh5X4plERiaEI_58l7fXs7zp0uqn_M,5976
78
- docling_core-2.30.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
79
- docling_core-2.30.0.dist-info/entry_points.txt,sha256=oClcdb2L2RKx4jdqUykY16Kum_f0_whwWhGzIodyidc,216
80
- docling_core-2.30.0.dist-info/RECORD,,
76
+ docling_core-2.30.1.dist-info/LICENSE,sha256=2M9-6EoQ1sxFztTOkXGAtwUDJvnWaAHdB9BYWVwGkIw,1087
77
+ docling_core-2.30.1.dist-info/METADATA,sha256=qvcnzM33mlJCxj-5MIz4VjdfAGHk-xiYqbNPzsEx6GY,5976
78
+ docling_core-2.30.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
79
+ docling_core-2.30.1.dist-info/entry_points.txt,sha256=oClcdb2L2RKx4jdqUykY16Kum_f0_whwWhGzIodyidc,216
80
+ docling_core-2.30.1.dist-info/RECORD,,