docling-client 2.120.1__py3-none-any.whl
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.
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: docling-client
|
|
3
|
+
Version: 2.120.1
|
|
4
|
+
Summary: Client SDK for converting documents via a remote Docling Serve endpoint.
|
|
5
|
+
Project-URL: homepage, https://github.com/docling-project/docling
|
|
6
|
+
Project-URL: repository, https://github.com/docling-project/docling
|
|
7
|
+
Project-URL: issues, https://github.com/docling-project/docling/issues
|
|
8
|
+
Project-URL: changelog, https://github.com/docling-project/docling/blob/main/CHANGELOG.md
|
|
9
|
+
Author-email: Christoph Auer <cau@zurich.ibm.com>, Michele Dolfi <dol@zurich.ibm.com>, Maxim Lysak <mly@zurich.ibm.com>, Nikos Livathinos <nli@zurich.ibm.com>, Ahmed Nassar <ahn@zurich.ibm.com>, Panos Vagenas <pva@zurich.ibm.com>, Peter Staar <taa@zurich.ibm.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
Keywords: api,client,convert,docling,document,pdf,remote,service
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
25
|
+
Requires-Python: <4.0,>=3.10
|
|
26
|
+
Requires-Dist: docling-slim[service-client]==2.120.1
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# Docling Client
|
|
30
|
+
|
|
31
|
+
**Lightweight client SDK for converting documents via a remote [Docling Serve](https://github.com/docling-project/docling-serve) endpoint**
|
|
32
|
+
|
|
33
|
+
`docling-client` is a meta-package that installs [`docling-slim[service-client]`](https://pypi.org/project/docling-slim/), giving you `DoclingServiceClient` — a drop-in replacement for the local `DocumentConverter` that offloads conversion to a Docling Serve instance over HTTP.
|
|
34
|
+
|
|
35
|
+
For the full documentation, see the [Docling docs](https://docling-project.github.io/docling/usage/api_server/).
|
|
36
|
+
|
|
37
|
+
## Why a remote client?
|
|
38
|
+
|
|
39
|
+
| You want to… | Use |
|
|
40
|
+
|---|---|
|
|
41
|
+
| Convert documents in a Python application, **without running models locally** | `docling-client` → point at a Docling Serve endpoint |
|
|
42
|
+
| Run Docling directly **in-process** in a Python application | [`docling`](https://pypi.org/project/docling/) |
|
|
43
|
+
| Full control over which extras are installed | [`docling-slim[service-client]`](https://pypi.org/project/docling-slim/) |
|
|
44
|
+
|
|
45
|
+
Switching from local to remote conversion typically requires changing only the client class and the endpoint URL — the conversion API (sources, options, output formats) stays the same.
|
|
46
|
+
|
|
47
|
+
## Getting started
|
|
48
|
+
|
|
49
|
+
### 1. Install
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install docling-client
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 2. Point at a Docling Serve endpoint
|
|
56
|
+
|
|
57
|
+
You need a running [Docling Serve](https://github.com/docling-project/docling-serve) instance — [self-hosted](https://docling-project.github.io/docling/usage/api_server/deployment/) or a [managed service](#managed-services).
|
|
58
|
+
|
|
59
|
+
Set your connection details in the environment (or a `.env` file):
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
DOCLING_SERVICE_URL=https://your-docling-service.example.com
|
|
63
|
+
DOCLING_SERVICE_API_KEY=your-api-key # omit if the service is unauthenticated
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 3. Convert a document
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
import os
|
|
70
|
+
from docling.service_client import DoclingServiceClient
|
|
71
|
+
|
|
72
|
+
with DoclingServiceClient(
|
|
73
|
+
url=os.environ["DOCLING_SERVICE_URL"],
|
|
74
|
+
api_key=os.environ.get("DOCLING_SERVICE_API_KEY", ""),
|
|
75
|
+
) as client:
|
|
76
|
+
result = client.convert(source="https://arxiv.org/pdf/2501.17887")
|
|
77
|
+
print(result.document.export_to_markdown())
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Convert many documents concurrently:
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
sources = [
|
|
84
|
+
"https://arxiv.org/pdf/2501.17887",
|
|
85
|
+
"path/to/report.pdf",
|
|
86
|
+
"path/to/slides.pptx",
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
with DoclingServiceClient(url=os.environ["DOCLING_SERVICE_URL"]) as client:
|
|
90
|
+
for result in client.convert_all(source=sources, max_concurrency=4):
|
|
91
|
+
print(result.input.file.name, result.status)
|
|
92
|
+
print(result.document.export_to_markdown()[:200])
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Switching from local to remote
|
|
96
|
+
|
|
97
|
+
If you already use the local `DocumentConverter`, the client API mirrors it closely. Only the import and instantiation change:
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
# Before — local, runs models on this machine
|
|
101
|
+
from docling.document_converter import DocumentConverter
|
|
102
|
+
converter = DocumentConverter()
|
|
103
|
+
result = converter.convert("report.pdf")
|
|
104
|
+
|
|
105
|
+
# After — remote, offloads conversion to Docling Serve
|
|
106
|
+
from docling.service_client import DoclingServiceClient
|
|
107
|
+
converter = DoclingServiceClient(url="https://...", api_key="...")
|
|
108
|
+
result = converter.convert(source="report.pdf")
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Both `result.document.export_to_markdown()` and other output methods work the same way.
|
|
112
|
+
|
|
113
|
+
## Managed services
|
|
114
|
+
|
|
115
|
+
Running [Docling Serve](https://github.com/docling-project/docling-serve) yourself means operating infrastructure. Managed services remove that overhead.
|
|
116
|
+
|
|
117
|
+
### Docling for IBM watsonx
|
|
118
|
+
|
|
119
|
+
A fully managed, hosted instance of Docling Serve — no servers, GPUs, scaling, or operational monitoring required. It exposes the same REST API, so your client code stays portable: swap the base URL, supply your API key, and go.
|
|
120
|
+
|
|
121
|
+
- [Product page](https://www.ibm.com/products/docling)
|
|
122
|
+
- [Free trial](https://www.ibm.com/products/docling) — no credit card needed
|
|
123
|
+
|
|
124
|
+
## More examples
|
|
125
|
+
|
|
126
|
+
Runnable examples are in [`docs/examples/service_client/`](https://github.com/docling-project/docling/tree/main/docs/examples/service_client/) in the repository:
|
|
127
|
+
|
|
128
|
+
| Script | What it shows |
|
|
129
|
+
|---|---|
|
|
130
|
+
| [`convert.py`](https://github.com/docling-project/docling/blob/main/docs/examples/service_client/convert.py) | `convert()` and `convert_all()` — the high-level API |
|
|
131
|
+
| [`tasks.py`](https://github.com/docling-project/docling/blob/main/docs/examples/service_client/tasks.py) | Job lifecycle: `submit()`, `watch()`, `result()`, result targets |
|
|
132
|
+
| [`batch.py`](https://github.com/docling-project/docling/blob/main/docs/examples/service_client/batch.py) | `submit_batch()` for plugin sources and artifact targets |
|
|
133
|
+
| [`chunk.py`](https://github.com/docling-project/docling/blob/main/docs/examples/service_client/chunk.py) | `chunk()` — split a document into retrieval-ready pieces |
|
|
134
|
+
|
|
135
|
+
## Documentation
|
|
136
|
+
|
|
137
|
+
- [API server overview](https://docling-project.github.io/docling/usage/api_server/)
|
|
138
|
+
- [Deployment guide](https://docling-project.github.io/docling/usage/api_server/deployment/)
|
|
139
|
+
- [Managed services](https://docling-project.github.io/docling/usage/api_server/managed/)
|
|
140
|
+
- [REST API reference](https://docling-project.github.io/docling/usage/api_server/rest_api/)
|
|
141
|
+
|
|
142
|
+
## License
|
|
143
|
+
|
|
144
|
+
MIT License — see [LICENSE](https://github.com/docling-project/docling/blob/main/LICENSE)
|