Skip to main content

docling-pp-ocrv6

A Docling OCR plugin for PaddlePaddle's PP-OCRv6 models.

This plugin seamlessly integrates with Docling's standard pipeline to provide local OCR capabilities using PaddlePaddle's PP-OCRv6 models. It runs the PP-OCRv6 detection and recognition ONNX checkpoints locally through RapidOCR (onnxruntime), so OCR happens inside the docling worker — no external service required.


GitHub  |  PyPI


PyPI version Python versions License CI Ruff Coverage

GPU acceleration is automatic when the docling accelerator device resolves to CUDA and onnxruntime-gpu is installed.

Installation

Pick exactly one onnxruntime extra — installing both the CPU and GPU wheels at once is unsupported and prevents the CUDA provider from registering:

pip install "docling-pp-ocrv6[cpu]"     # CPU (onnxruntime)
pip install "docling-pp-ocrv6[gpu]"     # CUDA (onnxruntime-gpu)

The detection and recognition ONNX models are downloaded from HuggingFace on first use and cached under docling's model cache. To pre-fetch them (e.g. at container build time):

from docling_pp_ocrv6 import PPOCRv6Model
PPOCRv6Model.download_models()

Usage

from docling.document_converter import DocumentConverter, PdfFormatOption
from docling.datamodel.base_models import InputFormat
from docling.datamodel.pipeline_options import PdfPipelineOptions
from docling_pp_ocrv6 import PPOCRv6Options

pipeline_options = PdfPipelineOptions(do_ocr=True)
pipeline_options.ocr_options = PPOCRv6Options()

converter = DocumentConverter(
    format_options={InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options)}
)
result = converter.convert("scanned.pdf")
print(result.document.export_to_markdown())

With docling-serve, request the engine by its kind:

{ "options": { "ocr": true, "ocr_engine": "pp-ocrv6" } }

(DOCLING_SERVE_ALLOW_EXTERNAL_PLUGINS=true must be set for the plugin to load.)

Configuration

All options are settable via PPOCRv6Options(...) or environment variables:

Option Env var Default
lang PPOCRV6_LANG de,en,fr,it,es,nl,pt,... (German-led European set)
text_score PPOCRV6_TEXT_SCORE 0.5
use_det / use_cls / use_rec PPOCRV6_USE_DET / _CLS / _REC true
det_repo PPOCRV6_DET_REPO PaddlePaddle/PP-OCRv6_medium_det_onnx
rec_repo PPOCRV6_REC_REPO PaddlePaddle/PP-OCRv6_medium_rec_onnx
det_model_path / rec_model_path / rec_keys_path / cls_model_path PPOCRV6_*_MODEL_PATH / _KEYS_PATH auto

The recognition character dictionary is extracted automatically from the recognition model's inference.yml. Angle classification uses RapidOCR's bundled cls model unless cls_model_path is set.

Development

make install   # uv sync + pre-commit
make check     # ruff lint + format check + ty type check
make test      # pytest with coverage

License

MIT

Metadata

Release files for docling-pp-ocrv6 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docling-pp-ocrv6 0.2.1
File Size Uploaded Provenance Actions
docling_pp_ocrv6-0.2.1.tar.gz 166.6 kB Without provenance Details for docling_pp_ocrv6-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for docling-pp-ocrv6 0.2.1
File Interpreter ABI Platform Actions
docling_pp_ocrv6-0.2.1-py3-none-any.whl Python 3 none any Details for docling_pp_ocrv6-0.2.1-py3-none-any.whl

Total release size: 179.7 kB

Release files / docling_pp_ocrv6-0.2.1.tar.gz

Download URL docling_pp_ocrv6-0.2.1.tar.gz
Size 166.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ec6cbb4583f69a31a19d9f3e1e5d980e9a3518207d019e221ef5ef1e841d8e95
BLAKE2b-256 checksum
How to use checksums
d851e7d7b7fe8e290569eafe6ba1c4d7c856fc62fd38ea1bfce8c1fb4153effb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / docling_pp_ocrv6-0.2.1-py3-none-any.whl

Download URL docling_pp_ocrv6-0.2.1-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c372875685d2aec9d44406a576f515c406093b5e6789f6425c12edc101e2b8b0
BLAKE2b-256 checksum
How to use checksums
bd578d3db568b400cd03bdb463cca86e1ad11de3a45605b97479ec334630eb30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for docling-pp-ocrv6 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page