# 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/21/87/0f779b7e2fda3b0d93f1c679e0a7cf9e9c07e1d12e5972aba4de835be3ea/docling_core-2.3.2.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.3.2",
"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": "3a95232d2c02cbd90c69fff9ce075e2f0c14b4bd972d7c6dddee889d60d20a4b",
"md5": "02c4013d7a0234d08f234eaf312f1eec",
"sha256": "53afd5a8c4e2ac25c9319dfba4474ad9e01d8e5e47cbd98144a98342ed5cd6b2"
},
"downloads": -1,
"filename": "docling_core-2.3.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "02c4013d7a0234d08f234eaf312f1eec",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 71436,
"upload_time": "2024-11-11T14:45:59",
"upload_time_iso_8601": "2024-11-11T14:45:59.155770Z",
"url": "https://files.pythonhosted.org/packages/3a/95/232d2c02cbd90c69fff9ce075e2f0c14b4bd972d7c6dddee889d60d20a4b/docling_core-2.3.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "21870f779b7e2fda3b0d93f1c679e0a7cf9e9c07e1d12e5972aba4de835be3ea",
"md5": "4a4874e2f7954de82f7d6d0566b0dd4a",
"sha256": "25afac26e620380e5363493383cf1573bb4ba319e9a17dff7b8af23b092f3f49"
},
"downloads": -1,
"filename": "docling_core-2.3.2.tar.gz",
"has_sig": false,
"md5_digest": "4a4874e2f7954de82f7d6d0566b0dd4a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 53651,
"upload_time": "2024-11-11T14:46:01",
"upload_time_iso_8601": "2024-11-11T14:46:01.049781Z",
"url": "https://files.pythonhosted.org/packages/21/87/0f779b7e2fda3b0d93f1c679e0a7cf9e9c07e1d12e5972aba4de835be3ea/docling_core-2.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-11 14:46:01",
"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"
}