# Docling Core
[![PyPI version](https://img.shields.io/pypi/v/docling-core)](https://pypi.org/project/docling-core/)
![Python](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%20%203.11%20%7C%203.12%20%7C%203.13-blue)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![License MIT](https://img.shields.io/github/license/ds4sd/docling-core)](https://opensource.org/licenses/MIT)
Docling Core is a library that defines the data types in [Docling](https://github.com/DS4SD/docling), leveraging pydantic models.
## Installation
To use Docling Core, simply install `docling-core` from your package manager, e.g. pip:
```bash
pip install docling-core
```
### Development setup
To develop for Docling Core, you need Python 3.9 / 3.10 / 3.11 / 3.12 / 3.13 and Poetry. You can then install from your local clone's root dir:
```bash
poetry install
```
To run the pytest suite, execute:
```
poetry run pytest test
```
## Basic Usage
- You can validate your JSON objects using the pydantic class definition.
```py
from docling_core.types import DoclingDocument
data_dict = {...} # here the object you want to validate, as a dictionary
DoclingDocument.model_validate(data_dict)
data_str = {...} # here the object as a JSON string
DoclingDocument.model_validate_json(data_str)
```
- You can generate the JSON schema of a model with the script `generate_jsonschema`.
```py
# for the `DoclingDocument` type
generate_jsonschema DoclingDocument
# for the use `Record` type
generate_jsonschema Record
```
## Documentation
Docling Core contains 3 top-level data types:
- **DoclingDocument** for publications like books, articles, reports, or patents. The JSON that can be exported using Docling follows this schema.
The DoclingDocument type also models the metadata that may be attached to the converted document.
Check [DoclingDocument](docs/DoclingDocument.json) for the full JSON schema.
- **Record** for structured database records, centered on an entity or _subject_ that is provided with a list of attributes.
Related to records, the statements can represent annotations on text by Natural Language Processing (NLP) tools.
Check [Record](docs/Record.json) for the full JSON schema.
- **Generic** for any data representation, ensuring minimal configuration and maximum flexibility.
Check [Generic](docs/Generic.json) for the full JSON schema.
The data schemas are defined using [pydantic](https://pydantic-docs.helpmanual.io/) models, which provide built-in processes to support the creation of data that adhere to those models.
## Contributing
Please read [Contributing to Docling Core](./CONTRIBUTING.md) for details.
## References
If you use Docling Core in your projects, please consider citing the following:
```bib
@techreport{Docling,
author = "Deep Search Team",
month = 8,
title = "Docling Technical Report",
url = "https://arxiv.org/abs/2408.09869",
eprint = "2408.09869",
doi = "10.48550/arXiv.2408.09869",
version = "1.0.0",
year = 2024
}
```
## License
The Docling Core codebase is under MIT license.
For individual model usage, please refer to the model licenses found in the original packages.
Raw data
{
"_id": null,
"home_page": "https://ds4sd.github.io/",
"name": "docling-core",
"maintainer": "Cesar Berrospi Ramis",
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": "ceb@zurich.ibm.com",
"keywords": "docling, discovery, etl, information retrieval, analytics, database, database schema, schema, JSON",
"author": "Cesar Berrospi Ramis",
"author_email": "ceb@zurich.ibm.com",
"download_url": "https://files.pythonhosted.org/packages/57/5e/6b8050522f0d2eca6d6aeddb0829e453689bb0ee4f9f893cd30961318392/docling_core-2.8.0.tar.gz",
"platform": null,
"description": "# Docling Core\n\n[![PyPI version](https://img.shields.io/pypi/v/docling-core)](https://pypi.org/project/docling-core/)\n![Python](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%20%203.11%20%7C%203.12%20%7C%203.13-blue)\n[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)\n[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)\n[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![License MIT](https://img.shields.io/github/license/ds4sd/docling-core)](https://opensource.org/licenses/MIT)\n\nDocling Core is a library that defines the data types in [Docling](https://github.com/DS4SD/docling), leveraging pydantic models.\n\n## Installation\n\nTo use Docling Core, simply install `docling-core` from your package manager, e.g. pip:\n```bash\npip install docling-core\n```\n\n### Development setup\n\nTo develop for Docling Core, you need Python 3.9 / 3.10 / 3.11 / 3.12 / 3.13 and Poetry. You can then install from your local clone's root dir:\n```bash\npoetry install\n```\n\nTo run the pytest suite, execute:\n```\npoetry run pytest test\n```\n\n## Basic Usage\n\n- You can validate your JSON objects using the pydantic class definition.\n\n ```py\n from docling_core.types import DoclingDocument\n\n data_dict = {...} # here the object you want to validate, as a dictionary\n DoclingDocument.model_validate(data_dict)\n\n data_str = {...} # here the object as a JSON string\n DoclingDocument.model_validate_json(data_str)\n ```\n\n- You can generate the JSON schema of a model with the script `generate_jsonschema`.\n\n ```py\n # for the `DoclingDocument` type\n generate_jsonschema DoclingDocument\n\n # for the use `Record` type\n generate_jsonschema Record\n ```\n\n## Documentation\n\nDocling Core contains 3 top-level data types:\n\n- **DoclingDocument** for publications like books, articles, reports, or patents. The JSON that can be exported using Docling follows this schema.\n The DoclingDocument type also models the metadata that may be attached to the converted document.\n Check [DoclingDocument](docs/DoclingDocument.json) for the full JSON schema.\n- **Record** for structured database records, centered on an entity or _subject_ that is provided with a list of attributes.\n Related to records, the statements can represent annotations on text by Natural Language Processing (NLP) tools.\n Check [Record](docs/Record.json) for the full JSON schema.\n- **Generic** for any data representation, ensuring minimal configuration and maximum flexibility.\n Check [Generic](docs/Generic.json) for the full JSON schema.\n\nThe data schemas are defined using [pydantic](https://pydantic-docs.helpmanual.io/) models, which provide built-in processes to support the creation of data that adhere to those models.\n\n## Contributing\n\nPlease read [Contributing to Docling Core](./CONTRIBUTING.md) for details.\n\n## References\n\nIf you use Docling Core in your projects, please consider citing the following:\n\n```bib\n@techreport{Docling,\n author = \"Deep Search Team\",\n month = 8,\n title = \"Docling Technical Report\",\n url = \"https://arxiv.org/abs/2408.09869\",\n eprint = \"2408.09869\",\n doi = \"10.48550/arXiv.2408.09869\",\n version = \"1.0.0\",\n year = 2024\n}\n```\n\n## License\n\nThe Docling Core codebase is under MIT license.\nFor individual model usage, please refer to the model licenses found in the original packages.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A python library to define and validate data types in Docling.",
"version": "2.8.0",
"project_urls": {
"Homepage": "https://ds4sd.github.io/",
"Repository": "https://github.com/DS4SD/docling-core"
},
"split_keywords": [
"docling",
" discovery",
" etl",
" information retrieval",
" analytics",
" database",
" database schema",
" schema",
" json"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "eb73b3c9d6c4b4b9febcf222736fa77a00a8397930aa14169c4166593d43eb5e",
"md5": "14050055e38596c039dfe8232a3eacf7",
"sha256": "392aad49e25f5fd1d279410118fbd91d9aaab9dd92d043738d20c10c57193d86"
},
"downloads": -1,
"filename": "docling_core-2.8.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "14050055e38596c039dfe8232a3eacf7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 83820,
"upload_time": "2024-12-06T14:10:51",
"upload_time_iso_8601": "2024-12-06T14:10:51.079342Z",
"url": "https://files.pythonhosted.org/packages/eb/73/b3c9d6c4b4b9febcf222736fa77a00a8397930aa14169c4166593d43eb5e/docling_core-2.8.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "575e6b8050522f0d2eca6d6aeddb0829e453689bb0ee4f9f893cd30961318392",
"md5": "272100038e5330eb736dd710078d779f",
"sha256": "6ac5cbc6f0abcbdf599c2a4b1a3f7b52fd8baebf3c4ebf94d7b7e2ee061a654e"
},
"downloads": -1,
"filename": "docling_core-2.8.0.tar.gz",
"has_sig": false,
"md5_digest": "272100038e5330eb736dd710078d779f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 64512,
"upload_time": "2024-12-06T14:10:53",
"upload_time_iso_8601": "2024-12-06T14:10:53.708874Z",
"url": "https://files.pythonhosted.org/packages/57/5e/6b8050522f0d2eca6d6aeddb0829e453689bb0ee4f9f893cd30961318392/docling_core-2.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-06 14:10:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DS4SD",
"github_project": "docling-core",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "docling-core"
}