docling 0.52.4

DocumentConverter and format backends for docling.rs (a Rust port of docling).
Documentation
[package]
name = "docling"
description = "DocumentConverter and format backends for docling.rs (a Rust port of docling)."
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
readme.workspace = true
keywords.workspace = true
categories.workspace = true
rust-version.workspace = true
# The 25 MB output-regression corpus under tests/ is dev-only — keep it out of
# the published crate (and under crates.io's size limit). benches/ reference that
# corpus by path, so they're dev-only too.
exclude = ["tests", "benches"]

[features]
# The default build is the full converter. The ML pipelines and the HTTP
# client are feature-sliced so `--no-default-features` leaves the pure-Rust
# declarative converters (DOCX/HTML/MD/XLSX/PPTX/… → md/json) — a set that
# compiles for wasm32-unknown-unknown (issue #79, see crates/docling-wasm).
default = ["pdf", "asr", "fetch-images", "vlm"]
# PDF/image/METS-GBS ML pipeline (pdfium + ONNX Runtime via docling-pdf).
pdf = ["dep:docling-pdf", "docling-pdf/ml"]
# Text-layer-only PDF conversion (docling-pdf's pure-Rust parser, no pdfium/
# ONNX) — the wasm32 PDF path. Subsumed by `pdf`, which converts everything.
pdf-text = ["dep:docling-pdf"]
# Audio → Whisper ASR (symphonia + ONNX Runtime via docling-asr).
asr = ["dep:docling-asr"]
# Blocking HTTP fetch of remote <img src> images (DocumentConverter::fetch_images).
fetch-images = ["dep:ureq", "dep:url"]
# Remote VLM pipeline (#77): render PDF pages via pdfium and convert them
# through an OpenAI-compatible vision endpoint (LM Studio / Ollama / vLLM /
# hosted), parsing the returned DocLang with the existing reader. Rides on the
# crate's existing blocking HTTP client; no model code compiled in.
vlm = ["pdf", "dep:ureq"]
# Optional headless-browser HTML pre-render (the `--use-web-browser` flag /
# `DocumentConverter::use_web_browser`). Off by default so the standard build
# stays pure-Rust with no browser/runtime dependency; enable with
# `--features web-browser`. Drives the system Chromium over the DevTools
# protocol purely from Rust (no Node/Playwright) via `headless_chrome`.
web-browser = ["dep:headless_chrome", "dep:tempfile"]
# Tokenization-aware chunking (docling-core's HybridChunker + HF tokenizer).
chunking = ["docling-core/chunking"]
# GPU execution providers for the PDF/image ML pipeline (#74) — pass-through
# to docling-pdf; select at runtime with DOCLING_RS_EP (default: cpu).
cuda = ["pdf", "docling-pdf/cuda"]
tensorrt = ["pdf", "docling-pdf/tensorrt"]
directml = ["pdf", "docling-pdf/directml"]
coreml = ["pdf", "docling-pdf/coreml"]

[dependencies]
calamine = { version = "0.26", features = ["dates"] }
csv = "1.4.0"
headless_chrome = { version = "1.0", optional = true }
# O_EXCL temp file with an unpredictable name for the browser pre-render page
# (avoids a predictable /tmp path a local attacker could pre-plant a symlink at).
tempfile = { version = "3", optional = true }
docling-asr = { path = "../docling-asr", version = "0.52.4", optional = true }
docling-core = { path = "../docling-core", version = "0.52.4" }
docling-pdf = { path = "../docling-pdf", version = "0.52.4", optional = true, default-features = false }
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "gif", "bmp", "tiff", "webp"] }
mail-parser = "0.11"
pulldown-cmark = { version = "0.13.4", default-features = false }
quick-xml = "0.41"
# Data-parallel fan-out over independent OOXML parts (XLSX sheets, PPTX
# slides) — see the profile in the module docs of `backend/xlsx.rs`.
rayon = "1.10"
regex = "1.11"
roxmltree = "0.20"
scraper = "0.27.0"
serde_json = "1"
# Blocking HTTP client for fetching remote <img src> images when image fetching
# is enabled (DocumentConverter::fetch_images). 3.x matches the version `ort`
# already pulls in (so the graph keeps a single ureq); it needs Rust 1.85, which
# this crate already requires transitively via docling-pdf → ort.
ureq = { version = "3", optional = true }
# Resolve relative / protocol-relative <img src> against the page's base URL
# when the HTML was fetched from the web (fetch_images). Gated with ureq.
url = { version = "2", optional = true }
zip = { version = "2.2", default-features = false, features = ["deflate"] }

[[example]]
name = "convert"
path = "examples/convert.rs"

[[example]]
name = "stream"
path = "examples/stream.rs"

[dev-dependencies]
criterion = "0.5"

[[bench]]
name = "parse"
harness = false