Dependency free extraction from documents.
Project description
udoc
Dependency free extraction from documents.
Extract text, tables, JSON, or rendered pages. CLI, Python Bindings, Pure Rust. No external parsers, libraries, or system packages are required. Provides hooks for OCR, layout detection, and entity extraction. Permissively licensed as dual MIT / Apache-2.0.
Supports PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, ODT, ODS, ODP, RTF, and Markdown.
The full hosted manual lives at https://newelh.github.io/udoc/.
Try it out using uv, no install required:
curl -sL https://arxiv.org/pdf/1706.03762 \
| uvx udoc - | grep -A 18 '^Abstract'
Installation
# uv
uv add udoc
# pip
pip install udoc
# cargo (coming soon)
To build from source, see the compile guide.
Highlights
- One
Documentmodel across formats. A content spine ofBlockandInlinenodes, plus optional presentation, relationships, and interactions overlays. Disable any overlay viaConfig. - Legacy binary Office. Native parsers for
.doc,.xls, and.ppt. Per-format details in the format guides. - Streaming page-by-page. The
Extractordefers per-page work. A 10 GB PDF does not have to fit in memory. - Typed diagnostics. Recoverable issues become structured warnings filterable by
kind. Examples: font fallbacks, malformedxref, stream-length mismatches. - Hooks for OCR, layout, and annotation. JSONL protocol for Tesseract, cloud OCR APIs, DocLayout-YOLO, GLM-OCR, vision-language models, NER, or any subprocess that reads JSON line-by-line.
- LLM tool use. Agent instructions — a paste-into-context page describing udoc's CLI to assistants.
Usage
CLI
udoc paper.pdf # text to stdout
udoc -j paper.pdf # full document as JSON
udoc -J paper.pdf # streaming JSONL (one record per page)
udoc -t spreadsheet.xlsx # tables only as TSV
udoc -p 1-5,10 paper.pdf # page range
udoc render paper.pdf -o ./pages # rasterise PDF pages to PNG
cat paper.pdf | udoc - # read from stdin
A few real-world piping recipes:
curl -sL https://arxiv.org/pdf/1706.03762 | udoc - | head -40
udoc paper.pdf | grep -i 'attention'
udoc -J docs/*.pdf | jq '.metadata.title'
Plain text on stdout. Structured output on flags. Stderr is silent unless you pass -v. The full flag list lives in the CLI reference.
Python
import udoc
# One-shot extraction. Format detected from magic bytes.
doc = udoc.extract("paper.pdf")
print(doc.metadata.title)
for block in doc.blocks():
print(block.text)
# Stream page by page; large documents do not have to fit in memory.
with udoc.stream("large.pdf") as ext:
for i in range(len(ext)):
print(f"page {i}: {ext.page_text(i)[:80]}")
# In-memory bytes with options.
with open("encrypted.pdf", "rb") as f:
doc = udoc.extract_bytes(f.read(), password="secret")
PDF table detection and reading order are heuristic. Born-digital documents with clean ruling and standard column flow extract cleanly out of the box; the PDF format guide covers the failure modes and when to attach a layout-detection or OCR hook.
The Guide walks through configuration, overlays, diagnostics, chunking, and batch processing. The Python Library reference lists every function, class, and exception.
Rust
let doc = udoc::extract("paper.pdf")?;
println!("{:?}", doc.metadata.title);
for block in &doc.content {
println!("{}", block.text());
}
The Rust facade mirrors the Python shape. Document is udoc_core::document::Document; iteration is by direct field access (doc.content, doc.metadata, doc.images). The Rust Library reference covers the facade, the per-format backends, configuration presets, diagnostics, and the trait that backends implement.
Status
This is the initial alpha release of udoc. APIs and outputs are subject to change. Bugs, ergonomic suggestions, and format quirks are welcome on the issue tracker.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file udoc-0.1.0a1.tar.gz.
File metadata
- Download URL: udoc-0.1.0a1.tar.gz
- Upload date:
- Size: 5.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d316d686848dc0841fbde830b562d29d2cb95c2fe247007efa42ba9daf4ac9ca
|
|
| MD5 |
36ae3353971ca432a07f1754ddaa2d97
|
|
| BLAKE2b-256 |
787c7edf0fe7eba23855e40b1984246bca439a6a9ca45eb6edc8c2895a4342ed
|
Provenance
The following attestation bundles were made for udoc-0.1.0a1.tar.gz:
Publisher:
release.yml on newelh/udoc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
udoc-0.1.0a1.tar.gz -
Subject digest:
d316d686848dc0841fbde830b562d29d2cb95c2fe247007efa42ba9daf4ac9ca - Sigstore transparency entry: 1436927956
- Sigstore integration time:
-
Permalink:
newelh/udoc@92d062d49d81254911cfd0e2bf7f1afbcb04c6ad -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/newelh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@92d062d49d81254911cfd0e2bf7f1afbcb04c6ad -
Trigger Event:
push
-
Statement type:
File details
Details for the file udoc-0.1.0a1-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: udoc-0.1.0a1-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 5.2 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
faba33bfe8479f0f661c8f0dc98ca7aee3b2971ea363b5658b13537662eca477
|
|
| MD5 |
2d7b21d9bd8c55351955b978a9695d0d
|
|
| BLAKE2b-256 |
458120faa1f420e7a3a587ff1001f9b756bab26a07fc053f6a36bb282031b2c4
|
Provenance
The following attestation bundles were made for udoc-0.1.0a1-cp310-abi3-win_amd64.whl:
Publisher:
release.yml on newelh/udoc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
udoc-0.1.0a1-cp310-abi3-win_amd64.whl -
Subject digest:
faba33bfe8479f0f661c8f0dc98ca7aee3b2971ea363b5658b13537662eca477 - Sigstore transparency entry: 1436928024
- Sigstore integration time:
-
Permalink:
newelh/udoc@92d062d49d81254911cfd0e2bf7f1afbcb04c6ad -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/newelh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@92d062d49d81254911cfd0e2bf7f1afbcb04c6ad -
Trigger Event:
push
-
Statement type:
File details
Details for the file udoc-0.1.0a1-cp310-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: udoc-0.1.0a1-cp310-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 10.7 MB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92e91f7752221ecc9ad7c7b766f73744521e7c45ace35f85f4a18c008a93ae95
|
|
| MD5 |
90abb482a5e0ba366a7db819da9775da
|
|
| BLAKE2b-256 |
c5ae883c74902752349d982179cdb2ad4f2283df60301b044ad7b91fb530a00c
|
Provenance
The following attestation bundles were made for udoc-0.1.0a1-cp310-abi3-manylinux_2_28_x86_64.whl:
Publisher:
release.yml on newelh/udoc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
udoc-0.1.0a1-cp310-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
92e91f7752221ecc9ad7c7b766f73744521e7c45ace35f85f4a18c008a93ae95 - Sigstore transparency entry: 1436928011
- Sigstore integration time:
-
Permalink:
newelh/udoc@92d062d49d81254911cfd0e2bf7f1afbcb04c6ad -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/newelh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@92d062d49d81254911cfd0e2bf7f1afbcb04c6ad -
Trigger Event:
push
-
Statement type:
File details
Details for the file udoc-0.1.0a1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: udoc-0.1.0a1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 10.1 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8440aae24b6a4caebc6e964fa356d5a1186358b0549b8677f2bb0361a615866b
|
|
| MD5 |
7d08b1bfc52c9833f67ecb57ea251587
|
|
| BLAKE2b-256 |
af38c7c21aee3c338111d7cb1886fc8365d0f8d1ae95a1a0d7140bcf01f60f5f
|
Provenance
The following attestation bundles were made for udoc-0.1.0a1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on newelh/udoc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
udoc-0.1.0a1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
8440aae24b6a4caebc6e964fa356d5a1186358b0549b8677f2bb0361a615866b - Sigstore transparency entry: 1436927994
- Sigstore integration time:
-
Permalink:
newelh/udoc@92d062d49d81254911cfd0e2bf7f1afbcb04c6ad -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/newelh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@92d062d49d81254911cfd0e2bf7f1afbcb04c6ad -
Trigger Event:
push
-
Statement type:
File details
Details for the file udoc-0.1.0a1-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: udoc-0.1.0a1-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 10.2 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea50dd1cb2e4adbc06ad6d4bb85c7ece458d05aff69129955ebf11aa8fd5dde5
|
|
| MD5 |
6586c16554096b533a73285de31caea9
|
|
| BLAKE2b-256 |
0bc3b2e2e772303427dbae66428a7cd762355af01853b41bc711a22a5a9d2178
|
Provenance
The following attestation bundles were made for udoc-0.1.0a1-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on newelh/udoc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
udoc-0.1.0a1-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
ea50dd1cb2e4adbc06ad6d4bb85c7ece458d05aff69129955ebf11aa8fd5dde5 - Sigstore transparency entry: 1436927976
- Sigstore integration time:
-
Permalink:
newelh/udoc@92d062d49d81254911cfd0e2bf7f1afbcb04c6ad -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/newelh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@92d062d49d81254911cfd0e2bf7f1afbcb04c6ad -
Trigger Event:
push
-
Statement type: