Metadata-Version: 2.4
Name: churro-ocr
Version: 0.2.0
Summary: Library-first OCR and layout detection for historical documents
Author: History Genie
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/stanford-oval/Churro
Project-URL: Documentation, https://stanford-oval.github.io/Churro/
Project-URL: Repository, https://github.com/stanford-oval/Churro
Project-URL: Issues, https://github.com/stanford-oval/Churro/issues
Keywords: ocr,layout-detection,historical-documents,llm
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: loguru<1,>=0.7.2
Requires-Dist: Pillow<12,>=10.4.0
Requires-Dist: rich<14,>=13.9.2
Requires-Dist: typer<1,>=0.12.3
Provides-Extra: llm
Requires-Dist: google-auth<3,>=2.41.1; extra == "llm"
Requires-Dist: litellm[caching]==1.82.3; extra == "llm"
Provides-Extra: azure
Requires-Dist: azure-ai-documentintelligence==1.0.2; extra == "azure"
Provides-Extra: hf
Requires-Dist: qwen-vl-utils; extra == "hf"
Requires-Dist: transformers[torch]<5,>=4.57.0; extra == "hf"
Requires-Dist: torchvision; extra == "hf"
Provides-Extra: vllm
Requires-Dist: transformers<5,>=4.57.0; extra == "vllm"
Requires-Dist: torchvision; extra == "vllm"
Requires-Dist: vllm<1,>=0.18; extra == "vllm"
Provides-Extra: mistral
Requires-Dist: mistralai<2,>=1.6.0; extra == "mistral"
Provides-Extra: local
Requires-Dist: litellm[caching]==1.82.3; extra == "local"
Provides-Extra: pdf
Requires-Dist: pypdfium2<6,>=5; extra == "pdf"
Provides-Extra: all
Requires-Dist: google-auth<3,>=2.41.1; extra == "all"
Requires-Dist: litellm[caching]==1.82.3; extra == "all"
Requires-Dist: azure-ai-documentintelligence==1.0.2; extra == "all"
Requires-Dist: qwen-vl-utils; extra == "all"
Requires-Dist: transformers[torch]<5,>=4.57.0; extra == "all"
Requires-Dist: torchvision; extra == "all"
Requires-Dist: vllm<1,>=0.18; extra == "all"
Requires-Dist: mistralai<2,>=1.6.0; extra == "all"
Requires-Dist: pypdfium2<6,>=5; extra == "all"
Dynamic: license-file

# churro-ocr

`churro-ocr` is a Python toolkit for OCR and page detection on historical documents.

Full documentation and project overview live at https://stanford-oval.github.io/Churro/.

## Install

Install only the pieces you need:

```bash
pip install churro-ocr
pip install "churro-ocr[llm]"
pip install "churro-ocr[local]"
pip install "churro-ocr[hf]"
pip install "churro-ocr[vllm]"
pip install "churro-ocr[azure]"
pip install "churro-ocr[mistral]"
pip install "churro-ocr[pdf]"
pip install "churro-ocr[all]"
```

## Which API Should You Use?

| Goal | API |
| --- | --- |
| OCR one page or one image | `OCRClient` |
| Detect page crops only | `DocumentPageDetector` |
| Run an end-to-end image or PDF OCR workflow | `DocumentOCRPipeline` |
| Tune backend/provider options directly | `build_ocr_backend(...)` + `OCRBackendSpec` |

## Quick Start

```python
from churro_ocr.ocr import OCRClient
from churro_ocr.providers import OCRBackendSpec, build_ocr_backend

backend = build_ocr_backend(
    OCRBackendSpec(
        provider="litellm",
        model="vertex_ai/gemini-2.5-flash",
    )
)

page = OCRClient(backend).ocr_image(image_path="scan.png")

print(page.text)
```

## More

- Overview: https://stanford-oval.github.io/Churro/
- Getting started: https://stanford-oval.github.io/Churro/getting-started.html
- Benchmark leaderboard: https://stanford-oval.github.io/Churro/leaderboard.html
- Provider setup: https://stanford-oval.github.io/Churro/guides/providers.html
- CLI docs: https://stanford-oval.github.io/Churro/cli.html
- API reference: https://stanford-oval.github.io/Churro/api/index.html
