docling-core 2.12.1__tar.gz → 2.13.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.

Potentially problematic release.


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

Files changed (62) hide show
  1. {docling_core-2.12.1 → docling_core-2.13.0}/PKG-INFO +1 -1
  2. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/doc/document.py +3 -3
  3. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/doc/labels.py +27 -5
  4. {docling_core-2.12.1 → docling_core-2.13.0}/pyproject.toml +1 -1
  5. {docling_core-2.12.1 → docling_core-2.13.0}/LICENSE +0 -0
  6. {docling_core-2.12.1 → docling_core-2.13.0}/README.md +0 -0
  7. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/__init__.py +0 -0
  8. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/cli/__init__.py +0 -0
  9. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/cli/view.py +0 -0
  10. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/py.typed +0 -0
  11. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/resources/schemas/doc/ANN.json +0 -0
  12. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/resources/schemas/doc/DOC.json +0 -0
  13. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/resources/schemas/doc/OCR-output.json +0 -0
  14. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/resources/schemas/doc/RAW.json +0 -0
  15. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/resources/schemas/generated/ccs_document_schema.json +0 -0
  16. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/resources/schemas/generated/minimal_document_schema_flat.json +0 -0
  17. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/resources/schemas/search/search_doc_mapping.json +0 -0
  18. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/resources/schemas/search/search_doc_mapping_v2.json +0 -0
  19. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/search/__init__.py +0 -0
  20. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/search/json_schema_to_search_mapper.py +0 -0
  21. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/search/mapping.py +0 -0
  22. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/search/meta.py +0 -0
  23. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/search/package.py +0 -0
  24. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/transforms/__init__.py +0 -0
  25. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/transforms/chunker/__init__.py +0 -0
  26. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/transforms/chunker/base.py +0 -0
  27. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/transforms/chunker/hierarchical_chunker.py +0 -0
  28. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/transforms/chunker/hybrid_chunker.py +0 -0
  29. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/__init__.py +0 -0
  30. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/base.py +0 -0
  31. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/doc/__init__.py +0 -0
  32. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/doc/base.py +0 -0
  33. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/doc/tokens.py +0 -0
  34. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/doc/utils.py +0 -0
  35. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/gen/__init__.py +0 -0
  36. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/gen/generic.py +0 -0
  37. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/io/__init__.py +0 -0
  38. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/legacy_doc/__init__.py +0 -0
  39. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/legacy_doc/base.py +0 -0
  40. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/legacy_doc/doc_ann.py +0 -0
  41. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/legacy_doc/doc_ocr.py +0 -0
  42. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/legacy_doc/doc_raw.py +0 -0
  43. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/legacy_doc/document.py +0 -0
  44. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/legacy_doc/tokens.py +0 -0
  45. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/nlp/__init__.py +0 -0
  46. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/nlp/qa.py +0 -0
  47. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/nlp/qa_labels.py +0 -0
  48. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/rec/__init__.py +0 -0
  49. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/rec/attribute.py +0 -0
  50. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/rec/base.py +0 -0
  51. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/rec/predicate.py +0 -0
  52. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/rec/record.py +0 -0
  53. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/rec/statement.py +0 -0
  54. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/types/rec/subject.py +0 -0
  55. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/utils/__init__.py +0 -0
  56. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/utils/alias.py +0 -0
  57. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/utils/file.py +0 -0
  58. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/utils/generate_docs.py +0 -0
  59. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/utils/generate_jsonschema.py +0 -0
  60. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/utils/legacy.py +0 -0
  61. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/utils/validate.py +0 -0
  62. {docling_core-2.12.1 → docling_core-2.13.0}/docling_core/utils/validators.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: docling-core
3
- Version: 2.12.1
3
+ Version: 2.13.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
@@ -14,7 +14,7 @@ import warnings
14
14
  from io import BytesIO
15
15
  from pathlib import Path
16
16
  from typing import Any, Dict, Final, List, Literal, Optional, Tuple, Union
17
- from urllib.parse import unquote
17
+ from urllib.parse import quote, unquote
18
18
 
19
19
  import pandas as pd
20
20
  import yaml
@@ -830,7 +830,7 @@ class PictureItem(FloatingItem):
830
830
  ):
831
831
  return default_response
832
832
 
833
- text = f"\n![Image]({str(self.image.uri)})\n"
833
+ text = f"\n![Image]({quote(str(self.image.uri))})\n"
834
834
  return text
835
835
 
836
836
  else:
@@ -884,7 +884,7 @@ class PictureItem(FloatingItem):
884
884
  ):
885
885
  return default_response
886
886
 
887
- img_text = f'<img src="{str(self.image.uri)}">'
887
+ img_text = f'<img src="{quote(str(self.image.uri))}">'
888
888
  return f"<figure>{caption_text}{img_text}</figure>"
889
889
 
890
890
  else:
@@ -1,12 +1,12 @@
1
1
  """Models for the labels types."""
2
2
 
3
3
  from enum import Enum
4
+ from typing import Tuple
4
5
 
5
6
 
6
7
  class DocItemLabel(str, Enum):
7
8
  """DocItemLabel."""
8
9
 
9
- # DocLayNet v2
10
10
  CAPTION = "caption"
11
11
  FOOTNOTE = "footnote"
12
12
  FORMULA = "formula"
@@ -26,12 +26,34 @@ class DocItemLabel(str, Enum):
26
26
  KEY_VALUE_REGION = "key_value_region"
27
27
 
28
28
  # Additional labels for markup-based formats (e.g. HTML, Word)
29
- PARAGRAPH = "paragraph" # explicitly a paragraph and not arbitrary text
29
+ PARAGRAPH = "paragraph"
30
30
  REFERENCE = "reference"
31
31
 
32
- def __str__(self):
33
- """Get string value."""
34
- return str(self.value)
32
+ @staticmethod
33
+ def get_color(label: "DocItemLabel") -> Tuple[int, int, int]:
34
+ """Return the RGB color associated with a given label."""
35
+ color_map = {
36
+ DocItemLabel.CAPTION: (255, 204, 153),
37
+ DocItemLabel.FOOTNOTE: (200, 200, 255),
38
+ DocItemLabel.FORMULA: (192, 192, 192),
39
+ DocItemLabel.LIST_ITEM: (153, 153, 255),
40
+ DocItemLabel.PAGE_FOOTER: (204, 255, 204),
41
+ DocItemLabel.PAGE_HEADER: (204, 255, 204),
42
+ DocItemLabel.PICTURE: (255, 204, 164),
43
+ DocItemLabel.SECTION_HEADER: (255, 153, 153),
44
+ DocItemLabel.TABLE: (255, 204, 204),
45
+ DocItemLabel.TEXT: (255, 255, 153),
46
+ DocItemLabel.TITLE: (255, 153, 153),
47
+ DocItemLabel.DOCUMENT_INDEX: (220, 220, 220),
48
+ DocItemLabel.CODE: (125, 125, 125),
49
+ DocItemLabel.CHECKBOX_SELECTED: (255, 182, 193),
50
+ DocItemLabel.CHECKBOX_UNSELECTED: (255, 182, 193),
51
+ DocItemLabel.FORM: (200, 255, 255),
52
+ DocItemLabel.KEY_VALUE_REGION: (183, 65, 14),
53
+ DocItemLabel.PARAGRAPH: (255, 255, 153),
54
+ DocItemLabel.REFERENCE: (176, 224, 230),
55
+ }
56
+ return color_map[label]
35
57
 
36
58
 
37
59
  class GroupLabel(str, Enum):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "docling-core"
3
- version = "2.12.1"
3
+ version = "2.13.0"
4
4
  description = "A python library to define and validate data types in Docling."
5
5
  license = "MIT"
6
6
  authors = [
File without changes
File without changes