docling-core 2.32.0__tar.gz → 2.33.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.
- docling_core-2.33.0/PKG-INFO +143 -0
- docling_core-2.33.0/README.md +99 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/doc/base.py +38 -0
- docling_core-2.33.0/docling_core.egg-info/PKG-INFO +143 -0
- docling_core-2.33.0/docling_core.egg-info/SOURCES.txt +104 -0
- docling_core-2.33.0/docling_core.egg-info/dependency_links.txt +1 -0
- docling_core-2.33.0/docling_core.egg-info/entry_points.txt +2 -0
- docling_core-2.33.0/docling_core.egg-info/requires.txt +18 -0
- docling_core-2.33.0/docling_core.egg-info/top_level.txt +1 -0
- docling_core-2.33.0/pyproject.toml +157 -0
- docling_core-2.33.0/setup.cfg +4 -0
- docling_core-2.33.0/test/test_base.py +295 -0
- docling_core-2.33.0/test/test_collection.py +158 -0
- docling_core-2.33.0/test/test_data_gen_flag.py +9 -0
- docling_core-2.33.0/test/test_doc_base.py +45 -0
- docling_core-2.33.0/test/test_doc_legacy_convert.py +40 -0
- docling_core-2.33.0/test/test_doc_schema.py +147 -0
- docling_core-2.33.0/test/test_doc_schema_extractor.py +31 -0
- docling_core-2.33.0/test/test_docling_doc.py +1603 -0
- docling_core-2.33.0/test/test_doctags_load.py +143 -0
- docling_core-2.33.0/test/test_hierarchical_chunker.py +73 -0
- docling_core-2.33.0/test/test_hybrid_chunker.py +384 -0
- docling_core-2.33.0/test/test_json_schema_to_search_mapper.py +106 -0
- docling_core-2.33.0/test/test_nlp_qa.py +46 -0
- docling_core-2.33.0/test/test_otsl_table_export.py +284 -0
- docling_core-2.33.0/test/test_page.py +79 -0
- docling_core-2.33.0/test/test_rec_schema.py +268 -0
- docling_core-2.33.0/test/test_search_meta.py +49 -0
- docling_core-2.33.0/test/test_serialization.py +372 -0
- docling_core-2.33.0/test/test_utils.py +94 -0
- docling_core-2.33.0/test/test_visualization.py +42 -0
- docling_core-2.32.0/PKG-INFO +0 -143
- docling_core-2.32.0/README.md +0 -97
- docling_core-2.32.0/pyproject.toml +0 -168
- {docling_core-2.32.0 → docling_core-2.33.0}/LICENSE +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/cli/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/cli/view.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/experimental/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/py.typed +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/resources/schemas/doc/ANN.json +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/resources/schemas/doc/DOC.json +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/resources/schemas/doc/OCR-output.json +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/resources/schemas/doc/RAW.json +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/resources/schemas/generated/ccs_document_schema.json +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/resources/schemas/generated/minimal_document_schema_flat.json +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/resources/schemas/search/search_doc_mapping.json +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/resources/schemas/search/search_doc_mapping_v2.json +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/search/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/search/json_schema_to_search_mapper.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/search/mapping.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/search/meta.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/search/package.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/chunker/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/chunker/base.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/chunker/hierarchical_chunker.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/chunker/hybrid_chunker.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/chunker/tokenizer/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/chunker/tokenizer/base.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/chunker/tokenizer/huggingface.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/chunker/tokenizer/openai.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/serializer/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/serializer/base.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/serializer/common.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/serializer/doctags.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/serializer/html.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/serializer/html_styles.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/serializer/markdown.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/visualizer/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/visualizer/base.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/visualizer/layout_visualizer.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/transforms/visualizer/reading_order_visualizer.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/base.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/doc/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/doc/document.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/doc/labels.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/doc/page.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/doc/tokens.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/doc/utils.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/gen/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/gen/generic.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/io/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/legacy_doc/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/legacy_doc/base.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/legacy_doc/doc_ann.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/legacy_doc/doc_ocr.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/legacy_doc/doc_raw.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/legacy_doc/document.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/legacy_doc/tokens.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/nlp/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/nlp/qa.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/nlp/qa_labels.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/rec/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/rec/attribute.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/rec/base.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/rec/predicate.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/rec/record.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/rec/statement.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/types/rec/subject.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/utils/__init__.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/utils/alias.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/utils/file.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/utils/generate_docs.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/utils/generate_jsonschema.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/utils/legacy.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/utils/validate.py +0 -0
- {docling_core-2.32.0 → docling_core-2.33.0}/docling_core/utils/validators.py +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: docling-core
|
|
3
|
+
Version: 2.33.0
|
|
4
|
+
Summary: A python library to define and validate data types in Docling.
|
|
5
|
+
Author-email: Cesar Berrospi Ramis <ceb@zurich.ibm.com>, Panos Vagenas <pva@zurich.ibm.com>, Michele Dolfi <dol@zurich.ibm.com>, Christoph Auer <cau@zurich.ibm.com>, Peter Staar <taa@zurich.ibm.com>
|
|
6
|
+
Maintainer-email: Panos Vagenas <pva@zurich.ibm.com>, Michele Dolfi <dol@zurich.ibm.com>, Christoph Auer <cau@zurich.ibm.com>, Peter Staar <taa@zurich.ibm.com>, Cesar Berrospi Ramis <ceb@zurich.ibm.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: homepage, https://github.com/docling-project
|
|
9
|
+
Project-URL: repository, https://github.com/docling-project/docling-core
|
|
10
|
+
Project-URL: issues, https://github.com/docling-project/docling-core/issues
|
|
11
|
+
Project-URL: changelog, https://github.com/docling-project/docling-core/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: docling,discovery,etl,information retrieval,analytics,database,database schema,schema,JSON
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Natural Language :: English
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Topic :: Database
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Classifier: Programming Language :: Python :: 3
|
|
24
|
+
Requires-Python: <4.0,>=3.9
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: jsonschema<5.0.0,>=4.16.0
|
|
28
|
+
Requires-Dist: pydantic!=2.10.0,!=2.10.1,!=2.10.2,<3.0.0,>=2.6.0
|
|
29
|
+
Requires-Dist: jsonref<2.0.0,>=1.1.0
|
|
30
|
+
Requires-Dist: tabulate<0.10.0,>=0.9.0
|
|
31
|
+
Requires-Dist: pandas<3.0.0,>=2.1.4
|
|
32
|
+
Requires-Dist: pillow<12.0.0,>=10.0.0
|
|
33
|
+
Requires-Dist: pyyaml<7.0.0,>=5.1
|
|
34
|
+
Requires-Dist: typing-extensions<5.0.0,>=4.12.2
|
|
35
|
+
Requires-Dist: typer<0.16.0,>=0.12.5
|
|
36
|
+
Requires-Dist: latex2mathml<4.0.0,>=3.77.0
|
|
37
|
+
Provides-Extra: chunking
|
|
38
|
+
Requires-Dist: semchunk<3.0.0,>=2.2.0; extra == "chunking"
|
|
39
|
+
Requires-Dist: transformers<5.0.0,>=4.34.0; extra == "chunking"
|
|
40
|
+
Provides-Extra: chunking-openai
|
|
41
|
+
Requires-Dist: semchunk; extra == "chunking-openai"
|
|
42
|
+
Requires-Dist: tiktoken<0.10.0,>=0.9.0; extra == "chunking-openai"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
# Docling Core
|
|
46
|
+
|
|
47
|
+
[](https://pypi.org/project/docling-core/)
|
|
48
|
+

|
|
49
|
+
[](https://github.com/astral-sh/uv)
|
|
50
|
+
[](https://github.com/psf/black)
|
|
51
|
+
[](https://pycqa.github.io/isort/)
|
|
52
|
+
[](https://mypy-lang.org/)
|
|
53
|
+
[](https://pydantic.dev)
|
|
54
|
+
[](https://github.com/pre-commit/pre-commit)
|
|
55
|
+
[](https://opensource.org/licenses/MIT)
|
|
56
|
+
|
|
57
|
+
Docling Core is a library that defines core data types and transformations in [Docling](https://github.com/docling-project/docling).
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
To use Docling Core, simply install `docling-core` from your package manager, e.g. pip:
|
|
62
|
+
```bash
|
|
63
|
+
pip install docling-core
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Development setup
|
|
67
|
+
|
|
68
|
+
To develop for Docling Core, you need Python 3.9 / 3.10 / 3.11 / 3.12 / 3.13 and uv. You can then install from your local clone's root dir:
|
|
69
|
+
```bash
|
|
70
|
+
uv sync --all-extras
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
To run the pytest suite, execute:
|
|
74
|
+
```
|
|
75
|
+
uv run pytest -s test
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Main features
|
|
79
|
+
|
|
80
|
+
Docling Core provides the foundational DoclingDocument data model and API, as well as
|
|
81
|
+
additional APIs for tasks like serialization and chunking, which are key to developing
|
|
82
|
+
generative AI applications using Docling.
|
|
83
|
+
|
|
84
|
+
### DoclingDocument
|
|
85
|
+
|
|
86
|
+
Docling Core defines the DoclingDocument as a Pydantic model, allowing for advanced
|
|
87
|
+
data model control, customizability, and interoperability.
|
|
88
|
+
|
|
89
|
+
In addition to specifying the schema, it provides a handy API for building documents,
|
|
90
|
+
as well as for basic operations, e.g. exporting to various formats, like Markdown, HTML,
|
|
91
|
+
and others.
|
|
92
|
+
|
|
93
|
+
👉 More details:
|
|
94
|
+
- [Architecture docs](https://docling-project.github.io/docling/concepts/architecture/)
|
|
95
|
+
- [DoclingDocument docs](https://docling-project.github.io/docling/concepts/docling_document/)
|
|
96
|
+
|
|
97
|
+
### Serialization
|
|
98
|
+
|
|
99
|
+
Different users can have varying requirements when it comes to serialization.
|
|
100
|
+
To address this, the Serialization API introduces a design that allows easy extension,
|
|
101
|
+
while providing feature-rich built-in implementations (on which the respective
|
|
102
|
+
DoclingDocument helpers are actually based).
|
|
103
|
+
|
|
104
|
+
👉 More details:
|
|
105
|
+
- [Serialization docs](https://docling-project.github.io/docling/concepts/serialization/)
|
|
106
|
+
- [Serialization example](https://docling-project.github.io/docling/examples/serialization/)
|
|
107
|
+
|
|
108
|
+
### Chunking
|
|
109
|
+
|
|
110
|
+
Similarly to above, the Chunking API provides built-in chunking capabilities as well as
|
|
111
|
+
a design that enables easy extension, this way tackling customization requirements of
|
|
112
|
+
different use cases.
|
|
113
|
+
|
|
114
|
+
👉 More details:
|
|
115
|
+
- [Chunking docs](https://docling-project.github.io/docling/concepts/chunking/)
|
|
116
|
+
- [Hybrid chunking example](https://docling-project.github.io/docling/examples/hybrid_chunking/)
|
|
117
|
+
- [Advanced chunking and serialization](https://docling-project.github.io/docling/examples/advanced_chunking_and_serialization/)
|
|
118
|
+
|
|
119
|
+
## Contributing
|
|
120
|
+
|
|
121
|
+
Please read [Contributing to Docling Core](./CONTRIBUTING.md) for details.
|
|
122
|
+
|
|
123
|
+
## References
|
|
124
|
+
|
|
125
|
+
If you use Docling Core in your projects, please consider citing the following:
|
|
126
|
+
|
|
127
|
+
```bib
|
|
128
|
+
@techreport{Docling,
|
|
129
|
+
author = "Deep Search Team",
|
|
130
|
+
month = 8,
|
|
131
|
+
title = "Docling Technical Report",
|
|
132
|
+
url = "https://arxiv.org/abs/2408.09869",
|
|
133
|
+
eprint = "2408.09869",
|
|
134
|
+
doi = "10.48550/arXiv.2408.09869",
|
|
135
|
+
version = "1.0.0",
|
|
136
|
+
year = 2024
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
The Docling Core codebase is under MIT license.
|
|
143
|
+
For individual model usage, please refer to the model licenses found in the original packages.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Docling Core
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/docling-core/)
|
|
4
|
+

|
|
5
|
+
[](https://github.com/astral-sh/uv)
|
|
6
|
+
[](https://github.com/psf/black)
|
|
7
|
+
[](https://pycqa.github.io/isort/)
|
|
8
|
+
[](https://mypy-lang.org/)
|
|
9
|
+
[](https://pydantic.dev)
|
|
10
|
+
[](https://github.com/pre-commit/pre-commit)
|
|
11
|
+
[](https://opensource.org/licenses/MIT)
|
|
12
|
+
|
|
13
|
+
Docling Core is a library that defines core data types and transformations in [Docling](https://github.com/docling-project/docling).
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
To use Docling Core, simply install `docling-core` from your package manager, e.g. pip:
|
|
18
|
+
```bash
|
|
19
|
+
pip install docling-core
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Development setup
|
|
23
|
+
|
|
24
|
+
To develop for Docling Core, you need Python 3.9 / 3.10 / 3.11 / 3.12 / 3.13 and uv. You can then install from your local clone's root dir:
|
|
25
|
+
```bash
|
|
26
|
+
uv sync --all-extras
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
To run the pytest suite, execute:
|
|
30
|
+
```
|
|
31
|
+
uv run pytest -s test
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Main features
|
|
35
|
+
|
|
36
|
+
Docling Core provides the foundational DoclingDocument data model and API, as well as
|
|
37
|
+
additional APIs for tasks like serialization and chunking, which are key to developing
|
|
38
|
+
generative AI applications using Docling.
|
|
39
|
+
|
|
40
|
+
### DoclingDocument
|
|
41
|
+
|
|
42
|
+
Docling Core defines the DoclingDocument as a Pydantic model, allowing for advanced
|
|
43
|
+
data model control, customizability, and interoperability.
|
|
44
|
+
|
|
45
|
+
In addition to specifying the schema, it provides a handy API for building documents,
|
|
46
|
+
as well as for basic operations, e.g. exporting to various formats, like Markdown, HTML,
|
|
47
|
+
and others.
|
|
48
|
+
|
|
49
|
+
👉 More details:
|
|
50
|
+
- [Architecture docs](https://docling-project.github.io/docling/concepts/architecture/)
|
|
51
|
+
- [DoclingDocument docs](https://docling-project.github.io/docling/concepts/docling_document/)
|
|
52
|
+
|
|
53
|
+
### Serialization
|
|
54
|
+
|
|
55
|
+
Different users can have varying requirements when it comes to serialization.
|
|
56
|
+
To address this, the Serialization API introduces a design that allows easy extension,
|
|
57
|
+
while providing feature-rich built-in implementations (on which the respective
|
|
58
|
+
DoclingDocument helpers are actually based).
|
|
59
|
+
|
|
60
|
+
👉 More details:
|
|
61
|
+
- [Serialization docs](https://docling-project.github.io/docling/concepts/serialization/)
|
|
62
|
+
- [Serialization example](https://docling-project.github.io/docling/examples/serialization/)
|
|
63
|
+
|
|
64
|
+
### Chunking
|
|
65
|
+
|
|
66
|
+
Similarly to above, the Chunking API provides built-in chunking capabilities as well as
|
|
67
|
+
a design that enables easy extension, this way tackling customization requirements of
|
|
68
|
+
different use cases.
|
|
69
|
+
|
|
70
|
+
👉 More details:
|
|
71
|
+
- [Chunking docs](https://docling-project.github.io/docling/concepts/chunking/)
|
|
72
|
+
- [Hybrid chunking example](https://docling-project.github.io/docling/examples/hybrid_chunking/)
|
|
73
|
+
- [Advanced chunking and serialization](https://docling-project.github.io/docling/examples/advanced_chunking_and_serialization/)
|
|
74
|
+
|
|
75
|
+
## Contributing
|
|
76
|
+
|
|
77
|
+
Please read [Contributing to Docling Core](./CONTRIBUTING.md) for details.
|
|
78
|
+
|
|
79
|
+
## References
|
|
80
|
+
|
|
81
|
+
If you use Docling Core in your projects, please consider citing the following:
|
|
82
|
+
|
|
83
|
+
```bib
|
|
84
|
+
@techreport{Docling,
|
|
85
|
+
author = "Deep Search Team",
|
|
86
|
+
month = 8,
|
|
87
|
+
title = "Docling Technical Report",
|
|
88
|
+
url = "https://arxiv.org/abs/2408.09869",
|
|
89
|
+
eprint = "2408.09869",
|
|
90
|
+
doi = "10.48550/arXiv.2408.09869",
|
|
91
|
+
version = "1.0.0",
|
|
92
|
+
year = 2024
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
The Docling Core codebase is under MIT license.
|
|
99
|
+
For individual model usage, please refer to the model licenses found in the original packages.
|
|
@@ -395,3 +395,41 @@ class BoundingBox(BaseModel):
|
|
|
395
395
|
raise ValueError("BoundingBoxes have different CoordOrigin")
|
|
396
396
|
|
|
397
397
|
return cls(l=left, t=top, r=right, b=bottom, coord_origin=origin)
|
|
398
|
+
|
|
399
|
+
def x_overlap_with(self, other: "BoundingBox") -> float:
|
|
400
|
+
"""Calculates the horizontal overlap with another bounding box."""
|
|
401
|
+
if self.coord_origin != other.coord_origin:
|
|
402
|
+
raise ValueError("BoundingBoxes have different CoordOrigin")
|
|
403
|
+
return max(0.0, min(self.r, other.r) - max(self.l, other.l))
|
|
404
|
+
|
|
405
|
+
def y_overlap_with(self, other: "BoundingBox") -> float:
|
|
406
|
+
"""Calculates the vertical overlap with another bounding box, respecting coordinate origin."""
|
|
407
|
+
if self.coord_origin != other.coord_origin:
|
|
408
|
+
raise ValueError("BoundingBoxes have different CoordOrigin")
|
|
409
|
+
if self.coord_origin == CoordOrigin.TOPLEFT:
|
|
410
|
+
return max(0.0, min(self.b, other.b) - max(self.t, other.t))
|
|
411
|
+
elif self.coord_origin == CoordOrigin.BOTTOMLEFT:
|
|
412
|
+
return max(0.0, min(self.t, other.t) - max(self.b, other.b))
|
|
413
|
+
raise ValueError("Unsupported CoordOrigin")
|
|
414
|
+
|
|
415
|
+
def union_area_with(self, other: "BoundingBox") -> float:
|
|
416
|
+
"""Calculates the union area with another bounding box."""
|
|
417
|
+
if self.coord_origin != other.coord_origin:
|
|
418
|
+
raise ValueError("BoundingBoxes have different CoordOrigin")
|
|
419
|
+
return self.area() + other.area() - self.intersection_area_with(other)
|
|
420
|
+
|
|
421
|
+
def x_union_with(self, other: "BoundingBox") -> float:
|
|
422
|
+
"""Calculates the horizontal union dimension with another bounding box."""
|
|
423
|
+
if self.coord_origin != other.coord_origin:
|
|
424
|
+
raise ValueError("BoundingBoxes have different CoordOrigin")
|
|
425
|
+
return max(0.0, max(self.r, other.r) - min(self.l, other.l))
|
|
426
|
+
|
|
427
|
+
def y_union_with(self, other: "BoundingBox") -> float:
|
|
428
|
+
"""Calculates the vertical union dimension with another bounding box, respecting coordinate origin."""
|
|
429
|
+
if self.coord_origin != other.coord_origin:
|
|
430
|
+
raise ValueError("BoundingBoxes have different CoordOrigin")
|
|
431
|
+
if self.coord_origin == CoordOrigin.TOPLEFT:
|
|
432
|
+
return max(0.0, max(self.b, other.b) - min(self.t, other.t))
|
|
433
|
+
elif self.coord_origin == CoordOrigin.BOTTOMLEFT:
|
|
434
|
+
return max(0.0, max(self.t, other.t) - min(self.b, other.b))
|
|
435
|
+
raise ValueError("Unsupported CoordOrigin")
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: docling-core
|
|
3
|
+
Version: 2.33.0
|
|
4
|
+
Summary: A python library to define and validate data types in Docling.
|
|
5
|
+
Author-email: Cesar Berrospi Ramis <ceb@zurich.ibm.com>, Panos Vagenas <pva@zurich.ibm.com>, Michele Dolfi <dol@zurich.ibm.com>, Christoph Auer <cau@zurich.ibm.com>, Peter Staar <taa@zurich.ibm.com>
|
|
6
|
+
Maintainer-email: Panos Vagenas <pva@zurich.ibm.com>, Michele Dolfi <dol@zurich.ibm.com>, Christoph Auer <cau@zurich.ibm.com>, Peter Staar <taa@zurich.ibm.com>, Cesar Berrospi Ramis <ceb@zurich.ibm.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: homepage, https://github.com/docling-project
|
|
9
|
+
Project-URL: repository, https://github.com/docling-project/docling-core
|
|
10
|
+
Project-URL: issues, https://github.com/docling-project/docling-core/issues
|
|
11
|
+
Project-URL: changelog, https://github.com/docling-project/docling-core/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: docling,discovery,etl,information retrieval,analytics,database,database schema,schema,JSON
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Natural Language :: English
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Topic :: Database
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Classifier: Programming Language :: Python :: 3
|
|
24
|
+
Requires-Python: <4.0,>=3.9
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: jsonschema<5.0.0,>=4.16.0
|
|
28
|
+
Requires-Dist: pydantic!=2.10.0,!=2.10.1,!=2.10.2,<3.0.0,>=2.6.0
|
|
29
|
+
Requires-Dist: jsonref<2.0.0,>=1.1.0
|
|
30
|
+
Requires-Dist: tabulate<0.10.0,>=0.9.0
|
|
31
|
+
Requires-Dist: pandas<3.0.0,>=2.1.4
|
|
32
|
+
Requires-Dist: pillow<12.0.0,>=10.0.0
|
|
33
|
+
Requires-Dist: pyyaml<7.0.0,>=5.1
|
|
34
|
+
Requires-Dist: typing-extensions<5.0.0,>=4.12.2
|
|
35
|
+
Requires-Dist: typer<0.16.0,>=0.12.5
|
|
36
|
+
Requires-Dist: latex2mathml<4.0.0,>=3.77.0
|
|
37
|
+
Provides-Extra: chunking
|
|
38
|
+
Requires-Dist: semchunk<3.0.0,>=2.2.0; extra == "chunking"
|
|
39
|
+
Requires-Dist: transformers<5.0.0,>=4.34.0; extra == "chunking"
|
|
40
|
+
Provides-Extra: chunking-openai
|
|
41
|
+
Requires-Dist: semchunk; extra == "chunking-openai"
|
|
42
|
+
Requires-Dist: tiktoken<0.10.0,>=0.9.0; extra == "chunking-openai"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
# Docling Core
|
|
46
|
+
|
|
47
|
+
[](https://pypi.org/project/docling-core/)
|
|
48
|
+

|
|
49
|
+
[](https://github.com/astral-sh/uv)
|
|
50
|
+
[](https://github.com/psf/black)
|
|
51
|
+
[](https://pycqa.github.io/isort/)
|
|
52
|
+
[](https://mypy-lang.org/)
|
|
53
|
+
[](https://pydantic.dev)
|
|
54
|
+
[](https://github.com/pre-commit/pre-commit)
|
|
55
|
+
[](https://opensource.org/licenses/MIT)
|
|
56
|
+
|
|
57
|
+
Docling Core is a library that defines core data types and transformations in [Docling](https://github.com/docling-project/docling).
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
To use Docling Core, simply install `docling-core` from your package manager, e.g. pip:
|
|
62
|
+
```bash
|
|
63
|
+
pip install docling-core
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Development setup
|
|
67
|
+
|
|
68
|
+
To develop for Docling Core, you need Python 3.9 / 3.10 / 3.11 / 3.12 / 3.13 and uv. You can then install from your local clone's root dir:
|
|
69
|
+
```bash
|
|
70
|
+
uv sync --all-extras
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
To run the pytest suite, execute:
|
|
74
|
+
```
|
|
75
|
+
uv run pytest -s test
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Main features
|
|
79
|
+
|
|
80
|
+
Docling Core provides the foundational DoclingDocument data model and API, as well as
|
|
81
|
+
additional APIs for tasks like serialization and chunking, which are key to developing
|
|
82
|
+
generative AI applications using Docling.
|
|
83
|
+
|
|
84
|
+
### DoclingDocument
|
|
85
|
+
|
|
86
|
+
Docling Core defines the DoclingDocument as a Pydantic model, allowing for advanced
|
|
87
|
+
data model control, customizability, and interoperability.
|
|
88
|
+
|
|
89
|
+
In addition to specifying the schema, it provides a handy API for building documents,
|
|
90
|
+
as well as for basic operations, e.g. exporting to various formats, like Markdown, HTML,
|
|
91
|
+
and others.
|
|
92
|
+
|
|
93
|
+
👉 More details:
|
|
94
|
+
- [Architecture docs](https://docling-project.github.io/docling/concepts/architecture/)
|
|
95
|
+
- [DoclingDocument docs](https://docling-project.github.io/docling/concepts/docling_document/)
|
|
96
|
+
|
|
97
|
+
### Serialization
|
|
98
|
+
|
|
99
|
+
Different users can have varying requirements when it comes to serialization.
|
|
100
|
+
To address this, the Serialization API introduces a design that allows easy extension,
|
|
101
|
+
while providing feature-rich built-in implementations (on which the respective
|
|
102
|
+
DoclingDocument helpers are actually based).
|
|
103
|
+
|
|
104
|
+
👉 More details:
|
|
105
|
+
- [Serialization docs](https://docling-project.github.io/docling/concepts/serialization/)
|
|
106
|
+
- [Serialization example](https://docling-project.github.io/docling/examples/serialization/)
|
|
107
|
+
|
|
108
|
+
### Chunking
|
|
109
|
+
|
|
110
|
+
Similarly to above, the Chunking API provides built-in chunking capabilities as well as
|
|
111
|
+
a design that enables easy extension, this way tackling customization requirements of
|
|
112
|
+
different use cases.
|
|
113
|
+
|
|
114
|
+
👉 More details:
|
|
115
|
+
- [Chunking docs](https://docling-project.github.io/docling/concepts/chunking/)
|
|
116
|
+
- [Hybrid chunking example](https://docling-project.github.io/docling/examples/hybrid_chunking/)
|
|
117
|
+
- [Advanced chunking and serialization](https://docling-project.github.io/docling/examples/advanced_chunking_and_serialization/)
|
|
118
|
+
|
|
119
|
+
## Contributing
|
|
120
|
+
|
|
121
|
+
Please read [Contributing to Docling Core](./CONTRIBUTING.md) for details.
|
|
122
|
+
|
|
123
|
+
## References
|
|
124
|
+
|
|
125
|
+
If you use Docling Core in your projects, please consider citing the following:
|
|
126
|
+
|
|
127
|
+
```bib
|
|
128
|
+
@techreport{Docling,
|
|
129
|
+
author = "Deep Search Team",
|
|
130
|
+
month = 8,
|
|
131
|
+
title = "Docling Technical Report",
|
|
132
|
+
url = "https://arxiv.org/abs/2408.09869",
|
|
133
|
+
eprint = "2408.09869",
|
|
134
|
+
doi = "10.48550/arXiv.2408.09869",
|
|
135
|
+
version = "1.0.0",
|
|
136
|
+
year = 2024
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
The Docling Core codebase is under MIT license.
|
|
143
|
+
For individual model usage, please refer to the model licenses found in the original packages.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
docling_core/__init__.py
|
|
5
|
+
docling_core/py.typed
|
|
6
|
+
docling_core.egg-info/PKG-INFO
|
|
7
|
+
docling_core.egg-info/SOURCES.txt
|
|
8
|
+
docling_core.egg-info/dependency_links.txt
|
|
9
|
+
docling_core.egg-info/entry_points.txt
|
|
10
|
+
docling_core.egg-info/requires.txt
|
|
11
|
+
docling_core.egg-info/top_level.txt
|
|
12
|
+
docling_core/cli/__init__.py
|
|
13
|
+
docling_core/cli/view.py
|
|
14
|
+
docling_core/experimental/__init__.py
|
|
15
|
+
docling_core/resources/schemas/doc/ANN.json
|
|
16
|
+
docling_core/resources/schemas/doc/DOC.json
|
|
17
|
+
docling_core/resources/schemas/doc/OCR-output.json
|
|
18
|
+
docling_core/resources/schemas/doc/RAW.json
|
|
19
|
+
docling_core/resources/schemas/generated/ccs_document_schema.json
|
|
20
|
+
docling_core/resources/schemas/generated/minimal_document_schema_flat.json
|
|
21
|
+
docling_core/resources/schemas/search/search_doc_mapping.json
|
|
22
|
+
docling_core/resources/schemas/search/search_doc_mapping_v2.json
|
|
23
|
+
docling_core/search/__init__.py
|
|
24
|
+
docling_core/search/json_schema_to_search_mapper.py
|
|
25
|
+
docling_core/search/mapping.py
|
|
26
|
+
docling_core/search/meta.py
|
|
27
|
+
docling_core/search/package.py
|
|
28
|
+
docling_core/transforms/__init__.py
|
|
29
|
+
docling_core/transforms/chunker/__init__.py
|
|
30
|
+
docling_core/transforms/chunker/base.py
|
|
31
|
+
docling_core/transforms/chunker/hierarchical_chunker.py
|
|
32
|
+
docling_core/transforms/chunker/hybrid_chunker.py
|
|
33
|
+
docling_core/transforms/chunker/tokenizer/__init__.py
|
|
34
|
+
docling_core/transforms/chunker/tokenizer/base.py
|
|
35
|
+
docling_core/transforms/chunker/tokenizer/huggingface.py
|
|
36
|
+
docling_core/transforms/chunker/tokenizer/openai.py
|
|
37
|
+
docling_core/transforms/serializer/__init__.py
|
|
38
|
+
docling_core/transforms/serializer/base.py
|
|
39
|
+
docling_core/transforms/serializer/common.py
|
|
40
|
+
docling_core/transforms/serializer/doctags.py
|
|
41
|
+
docling_core/transforms/serializer/html.py
|
|
42
|
+
docling_core/transforms/serializer/html_styles.py
|
|
43
|
+
docling_core/transforms/serializer/markdown.py
|
|
44
|
+
docling_core/transforms/visualizer/__init__.py
|
|
45
|
+
docling_core/transforms/visualizer/base.py
|
|
46
|
+
docling_core/transforms/visualizer/layout_visualizer.py
|
|
47
|
+
docling_core/transforms/visualizer/reading_order_visualizer.py
|
|
48
|
+
docling_core/types/__init__.py
|
|
49
|
+
docling_core/types/base.py
|
|
50
|
+
docling_core/types/doc/__init__.py
|
|
51
|
+
docling_core/types/doc/base.py
|
|
52
|
+
docling_core/types/doc/document.py
|
|
53
|
+
docling_core/types/doc/labels.py
|
|
54
|
+
docling_core/types/doc/page.py
|
|
55
|
+
docling_core/types/doc/tokens.py
|
|
56
|
+
docling_core/types/doc/utils.py
|
|
57
|
+
docling_core/types/gen/__init__.py
|
|
58
|
+
docling_core/types/gen/generic.py
|
|
59
|
+
docling_core/types/io/__init__.py
|
|
60
|
+
docling_core/types/legacy_doc/__init__.py
|
|
61
|
+
docling_core/types/legacy_doc/base.py
|
|
62
|
+
docling_core/types/legacy_doc/doc_ann.py
|
|
63
|
+
docling_core/types/legacy_doc/doc_ocr.py
|
|
64
|
+
docling_core/types/legacy_doc/doc_raw.py
|
|
65
|
+
docling_core/types/legacy_doc/document.py
|
|
66
|
+
docling_core/types/legacy_doc/tokens.py
|
|
67
|
+
docling_core/types/nlp/__init__.py
|
|
68
|
+
docling_core/types/nlp/qa.py
|
|
69
|
+
docling_core/types/nlp/qa_labels.py
|
|
70
|
+
docling_core/types/rec/__init__.py
|
|
71
|
+
docling_core/types/rec/attribute.py
|
|
72
|
+
docling_core/types/rec/base.py
|
|
73
|
+
docling_core/types/rec/predicate.py
|
|
74
|
+
docling_core/types/rec/record.py
|
|
75
|
+
docling_core/types/rec/statement.py
|
|
76
|
+
docling_core/types/rec/subject.py
|
|
77
|
+
docling_core/utils/__init__.py
|
|
78
|
+
docling_core/utils/alias.py
|
|
79
|
+
docling_core/utils/file.py
|
|
80
|
+
docling_core/utils/generate_docs.py
|
|
81
|
+
docling_core/utils/generate_jsonschema.py
|
|
82
|
+
docling_core/utils/legacy.py
|
|
83
|
+
docling_core/utils/validate.py
|
|
84
|
+
docling_core/utils/validators.py
|
|
85
|
+
test/test_base.py
|
|
86
|
+
test/test_collection.py
|
|
87
|
+
test/test_data_gen_flag.py
|
|
88
|
+
test/test_doc_base.py
|
|
89
|
+
test/test_doc_legacy_convert.py
|
|
90
|
+
test/test_doc_schema.py
|
|
91
|
+
test/test_doc_schema_extractor.py
|
|
92
|
+
test/test_docling_doc.py
|
|
93
|
+
test/test_doctags_load.py
|
|
94
|
+
test/test_hierarchical_chunker.py
|
|
95
|
+
test/test_hybrid_chunker.py
|
|
96
|
+
test/test_json_schema_to_search_mapper.py
|
|
97
|
+
test/test_nlp_qa.py
|
|
98
|
+
test/test_otsl_table_export.py
|
|
99
|
+
test/test_page.py
|
|
100
|
+
test/test_rec_schema.py
|
|
101
|
+
test/test_search_meta.py
|
|
102
|
+
test/test_serialization.py
|
|
103
|
+
test/test_utils.py
|
|
104
|
+
test/test_visualization.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
jsonschema<5.0.0,>=4.16.0
|
|
2
|
+
pydantic!=2.10.0,!=2.10.1,!=2.10.2,<3.0.0,>=2.6.0
|
|
3
|
+
jsonref<2.0.0,>=1.1.0
|
|
4
|
+
tabulate<0.10.0,>=0.9.0
|
|
5
|
+
pandas<3.0.0,>=2.1.4
|
|
6
|
+
pillow<12.0.0,>=10.0.0
|
|
7
|
+
pyyaml<7.0.0,>=5.1
|
|
8
|
+
typing-extensions<5.0.0,>=4.12.2
|
|
9
|
+
typer<0.16.0,>=0.12.5
|
|
10
|
+
latex2mathml<4.0.0,>=3.77.0
|
|
11
|
+
|
|
12
|
+
[chunking]
|
|
13
|
+
semchunk<3.0.0,>=2.2.0
|
|
14
|
+
transformers<5.0.0,>=4.34.0
|
|
15
|
+
|
|
16
|
+
[chunking-openai]
|
|
17
|
+
semchunk
|
|
18
|
+
tiktoken<0.10.0,>=0.9.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
docling_core
|