Name | llama-index-readers-docling JSON |
Version |
0.4.0
JSON |
| download |
home_page | None |
Summary | llama-index readers docling integration |
upload_time | 2025-07-30 23:09:15 |
maintainer | None |
docs_url | None |
author | None |
requires_python | <3.13,>=3.10 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Docling Reader
## Overview
Docling Reader uses [Docling](https://github.com/DS4SD/docling) to enable fast and easy extraction of PDF, DOCX, HTML, and other document types, into Markdown or JSON-serialized Docling format, for usage in LlamaIndex pipelines for RAG / QA etc.
## Installation
```console
pip install llama-index-readers-docling
```
## Usage
### Markdown export
By default, Docling Reader exports to Markdown. Basic usage looks like this:
```python
from llama_index.readers.docling import DoclingReader
reader = DoclingReader()
docs = reader.load_data(file_path="https://arxiv.org/pdf/2408.09869")
print(f"{docs[0].text[389:442]}...")
# > ## Abstract
# >
# > This technical report introduces Docling...
```
### JSON export
Docling Reader can also export Docling's native format to JSON:
```python
from llama_index.readers.docling import DoclingReader
reader = DoclingReader(export_type=DoclingReader.ExportType.JSON)
docs = reader.load_data(file_path="https://arxiv.org/pdf/2408.09869")
print(f"{docs[0].text[:53]}...")
# > {"schema_name": "DoclingDocument", "version": "1.0.0"...
```
> [!IMPORTANT]
> To appropriately parse Docling's native format, when using JSON export make sure
> to use a Docling Node Parser in your pipeline.
### With Simple Directory Reader
The Docling Reader can also be used directly in combination with Simple Directory Reader, for example:
```python
from llama_index.core import SimpleDirectoryReader
dir_reader = SimpleDirectoryReader(
input_dir="/path/to/docs",
file_extractor={".pdf": reader},
)
docs = dir_reader.load_data()
print(docs[0].metadata)
# > {'file_path': '/path/to/docs/2408.09869v3.pdf',
# > 'file_name': '2408.09869v3.pdf',
# > 'file_type': 'application/pdf',
# > 'file_size': 5566574,
# > 'creation_date': '2024-10-06',
# > 'last_modified_date': '2024-10-03'}
```
Raw data
{
"_id": null,
"home_page": null,
"name": "llama-index-readers-docling",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Panos Vagenas <pva@zurich.ibm.com>",
"download_url": "https://files.pythonhosted.org/packages/47/ac/cfa4ed6417c5dd349039086ec2768aa0858b8fde11bc9acf16faba7124fb/llama_index_readers_docling-0.4.0.tar.gz",
"platform": null,
"description": "# Docling Reader\n\n## Overview\n\nDocling Reader uses [Docling](https://github.com/DS4SD/docling) to enable fast and easy extraction of PDF, DOCX, HTML, and other document types, into Markdown or JSON-serialized Docling format, for usage in LlamaIndex pipelines for RAG / QA etc.\n\n## Installation\n\n```console\npip install llama-index-readers-docling\n```\n\n## Usage\n\n### Markdown export\n\nBy default, Docling Reader exports to Markdown. Basic usage looks like this:\n\n```python\nfrom llama_index.readers.docling import DoclingReader\n\nreader = DoclingReader()\ndocs = reader.load_data(file_path=\"https://arxiv.org/pdf/2408.09869\")\nprint(f\"{docs[0].text[389:442]}...\")\n# > ## Abstract\n# >\n# > This technical report introduces Docling...\n```\n\n### JSON export\n\nDocling Reader can also export Docling's native format to JSON:\n\n```python\nfrom llama_index.readers.docling import DoclingReader\n\nreader = DoclingReader(export_type=DoclingReader.ExportType.JSON)\ndocs = reader.load_data(file_path=\"https://arxiv.org/pdf/2408.09869\")\nprint(f\"{docs[0].text[:53]}...\")\n# > {\"schema_name\": \"DoclingDocument\", \"version\": \"1.0.0\"...\n```\n\n> [!IMPORTANT]\n> To appropriately parse Docling's native format, when using JSON export make sure\n> to use a Docling Node Parser in your pipeline.\n\n### With Simple Directory Reader\n\nThe Docling Reader can also be used directly in combination with Simple Directory Reader, for example:\n\n```python\nfrom llama_index.core import SimpleDirectoryReader\n\ndir_reader = SimpleDirectoryReader(\n input_dir=\"/path/to/docs\",\n file_extractor={\".pdf\": reader},\n)\ndocs = dir_reader.load_data()\nprint(docs[0].metadata)\n# > {'file_path': '/path/to/docs/2408.09869v3.pdf',\n# > 'file_name': '2408.09869v3.pdf',\n# > 'file_type': 'application/pdf',\n# > 'file_size': 5566574,\n# > 'creation_date': '2024-10-06',\n# > 'last_modified_date': '2024-10-03'}\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "llama-index readers docling integration",
"version": "0.4.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "314c8cf38d8e18929642395d6724857f7bef16d6a0857c2c7574234da08df2ff",
"md5": "0e7c23573cd29c54a6eca6ebd3a48545",
"sha256": "da25c8eb050e5c01c0b76474ebab0cb0e70ff7f8c7f3e14d02d399a2f324d15a"
},
"downloads": -1,
"filename": "llama_index_readers_docling-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0e7c23573cd29c54a6eca6ebd3a48545",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.10",
"size": 4388,
"upload_time": "2025-07-30T23:09:14",
"upload_time_iso_8601": "2025-07-30T23:09:14.944293Z",
"url": "https://files.pythonhosted.org/packages/31/4c/8cf38d8e18929642395d6724857f7bef16d6a0857c2c7574234da08df2ff/llama_index_readers_docling-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "47accfa4ed6417c5dd349039086ec2768aa0858b8fde11bc9acf16faba7124fb",
"md5": "0738f36792ecfaa27f8cdf3ad2ef5385",
"sha256": "6fd531256961fca9df4c839c29ef63896083d55927a9e247da1423ac3366b0e8"
},
"downloads": -1,
"filename": "llama_index_readers_docling-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "0738f36792ecfaa27f8cdf3ad2ef5385",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.10",
"size": 4817,
"upload_time": "2025-07-30T23:09:15",
"upload_time_iso_8601": "2025-07-30T23:09:15.715017Z",
"url": "https://files.pythonhosted.org/packages/47/ac/cfa4ed6417c5dd349039086ec2768aa0858b8fde11bc9acf16faba7124fb/llama_index_readers_docling-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-30 23:09:15",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-readers-docling"
}