---
title: "docling-core | pypx"
description: "A python library to define and validate data types in Docling."
canonical_url: "https://pypx.app/packages/docling-core"
meta:
  "og:description": "A python library to define and validate data types in Docling."
  "og:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_docling-core%2Cversion_2.108.0%2Csummary_A%2Bpython%2Blibrary%2Bto%2Bdefine%2Band%2Bvalidate%2Bdata%2Btypes%2Bin%2BDocling.%2Clicense_MIT%2Cp_Ii9wYWNrYWdlcy9kb2NsaW5nLWNvcmUi%2Cs_n9gwQlC_5yRueOs4.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "docling-core 2.108.0"
  "twitter:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_docling-core%2Cversion_2.108.0%2Csummary_A%2Bpython%2Blibrary%2Bto%2Bdefine%2Band%2Bvalidate%2Bdata%2Btypes%2Bin%2BDocling.%2Clicense_MIT%2Cp_Ii9wYWNrYWdlcy9kb2NsaW5nLWNvcmUi%2Cs_n9gwQlC_5yRueOs4.png"
---

> Index of every page on this site: [llms.txt](https://pypx.app/llms.txt)

# **docling-core**

v2.108.0

A python library to define and validate data types in Docling.

350 KB Python 3.10+ py3-none-anyMIT14 deps

[**Diff **](https://pypx.app/packages/docling-core/diff)

`$ uv add docling-core`

# 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.10%20%7C%20%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14%20%7C%203.15-blue) [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev) [![prek](https://img.shields.io/badge/prek-enabled-brightgreen)](https://pypi.org/project/prek/) [![License MIT](https://img.shields.io/github/license/docling-project/docling-core)](https://opensource.org/licenses/MIT)

Docling Core is a library that defines core data types and transformations in [Docling](https://github.com/docling-project/docling).

## Installation

To use Docling Core, simply install `docling-core` from your package manager, e.g. pip:

```
pip install docling-core
```

### Development setup

To develop for Docling Core, you need Python 3.10 through 3.15 and the `uv` package. You can then install it from your local clone's root directory:

```
uv sync --all-extras
```

To run the pytest suite, execute:

```
uv run pytest -s test
```

## Main features

Docling Core provides the foundational DoclingDocument data model and API, as well as additional APIs for tasks like serialization and chunking, which are key to developing generative AI applications using Docling.

### DoclingDocument

Docling Core defines the DoclingDocument as a Pydantic model, allowing for advanced data model control, customizability, and interoperability.

In addition to specifying the schema, it provides a handy API for building documents, as well as for basic operations, e.g. exporting to various formats, like Markdown, HTML, and others.

👉 More details:

- [Architecture docs](https://docling-project.github.io/docling/concepts/architecture/)
- [DoclingDocument docs](https://docling-project.github.io/docling/concepts/docling_document/)

### Serialization

Different users can have varying requirements when it comes to serialization. To address this, the Serialization API introduces a design that allows easy extension, while providing feature-rich built-in implementations (on which the respective DoclingDocument helpers are actually based).

👉 More details:

- [Serialization docs](https://docling-project.github.io/docling/concepts/serialization/)
- [Serialization example](https://docling-project.github.io/docling/examples/serialization/)

### Chunking

Similarly to above, the Chunking API provides built-in chunking capabilities as well as a design that enables easy extension, this way tackling customization requirements of different use cases.

👉 More details:

- [Chunking docs](https://docling-project.github.io/docling/concepts/chunking/)
- [Hybrid chunking example](https://docling-project.github.io/docling/examples/hybrid_chunking/)
- [Advanced chunking and serialization](https://docling-project.github.io/docling/examples/advanced_chunking_and_serialization/)

### Profiling

The Profiling API enables extraction of comprehensive statistics from DoclingDocument objects, both for individual documents and collections. It provides metrics on document structure (pages, tables, pictures, text items) along with statistical distributions (deciles, histograms) and visualization capabilities for analyzing document collections at scale.

👉 More details:

- [Document profiling example](https://pypx.app/examples/document_profiling.py)
- [Collection statistics visualization](https://pypx.app/examples/visualize_collection_stats.py)

## Configuration

Runtime settings are read from environment variables with the `DOCLINGCORE_` prefix, or set in code via `docling_core.utils.settings.settings`.

### Local image files

Images in a DoclingDocument may reference a local file, either as a filesystem path or as a `file://` URI. Since such documents may come from untrusted sources, docling-core does not read these files by default, and raises a `ValueError` instead. This affects, for example, documents saved with `ImageRefMode.REFERENCED` and loaded again.

For trusted documents, either enable it globally:

```
export DOCLINGCORE_ALLOW_IMAGE_FILE_URI=true
```

```
from docling_core.utils.settings import settings

settings.allow_image_file_uri = True
```

or per document, reading its local images into memory at load time:

```
from docling_core.types.doc import DoclingDocument

doc = DoclingDocument.load_from_json("doc.json", allow_local_images=True)
# or, for a document obtained otherwise:
doc.load_local_images(base_dir=...)
```

## Contributing

Please read [Contributing to Docling Core](https://pypx.app/CONTRIBUTING.md) for details.

## References

If you use Docling Core in your projects, please consider citing the following:

```
@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.

## **Details **

<dl>

<dt>Version</dt>
<dd>2.108.0</dd>

<dt>License</dt>
<dd>MIT</dd>

<dt>Python</dt>
<dd>&lt;4.0,&gt;=3.10</dd>

<dt>Maintainer</dt>
<dd>Cesar Berrospi Ramis &lt;ceb@zurich.ibm.com&gt;, Panos Vagenas &lt;pva@zurich.ibm.com&gt;, Michele Dolfi &lt;dol@zurich.ibm.com&gt;, Christoph Auer &lt;cau@zurich.ibm.com&gt;, Peter Staar &lt;taa@zurich.ibm.com&gt;</dd></dl>

## **Links**

- [changelog](https://github.com/docling-project/docling-core/blob/main/CHANGELOG.md)
- [homepage](https://github.com/docling-project)
- [issues](https://github.com/docling-project/docling-core/issues)
- [repository](https://github.com/docling-project/docling-core)
- [View on PyPI](https://pypi.org/project/docling-core/)

## **Release Cadence **

**78**

releases in the past year

avg 4 days between releases

## **Maintainers **

- Cesar Berrospi Ramis · [ceb@zurich.ibm.com](mailto:ceb@zurich.ibm.com)
- Panos Vagenas · [pva@zurich.ibm.com](mailto:pva@zurich.ibm.com)
- Michele Dolfi · [dol@zurich.ibm.com](mailto:dol@zurich.ibm.com)
- Christoph Auer · [cau@zurich.ibm.com](mailto:cau@zurich.ibm.com)
- Peter Staar · [taa@zurich.ibm.com](mailto:taa@zurich.ibm.com)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://pypx.app/#website","@type":"WebSite","description":"The Python Package Index, reimagined. Fast search, dependency insights, download trends, and changelogs — all in one place.","name":"pypx","url":"https://pypx.app/"},{"@id":"https://pypx.app/packages/docling-core#webpage","@type":"WebPage","description":"A python library to define and validate data types in Docling.","name":"docling-core","url":"https://pypx.app/packages/docling-core","isPartOf":{"@id":"https://pypx.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://pypx.app/packages/docling-core"]}]},{"@id":"https://pypx.app/packages/docling-core#/schema/software-application/1","@type":"SoftwareApplication","applicationCategory":"DeveloperApplication","description":"A python library to define and validate data types in Docling.","license":"MIT","name":"docling-core","softwareVersion":"2.108.0"}]}
```

## Sitemap

See the full [sitemap](https://pypx.app/sitemap.md) for all pages.
