Metadata-Version: 2.4
Name: omniocr
Version: 0.1.0
Summary: Run ~any open source OCR model behind a single API.
Project-URL: Homepage, https://omniocr.ai
Author-email: Joe Barrow <joseph.d.barrow@gmail.com>
Keywords: document,ocr,pdf,text-extraction
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Classifier: Topic :: Text Processing
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: pillow>=12.1.1
Requires-Dist: pydantic>=2.12.5
Requires-Dist: requests>=2.33.0
Description-Content-Type: text/markdown

# `omniocr`

Python packge for using OmniOcr: https://omniocr.ai

```
pip install omniocr
```

## Usage

Get your API key from: https://omniocr.ai/

Then you can start to OCR documents with:

```sh
export OMNIOCR_API_KEY=<OMNIOCR_API_KEY>

omniocr examples/resources/sample.pdf \
    --model=lightonocr-2-1b \
    --format=markdown \
    --pages "1-3" > output.md
```

Alternatively, you can run it programmatically:

```py
from omniocr import OmniOcr


client = OmniOcr()

document = client.process(
    "examples/resources/sample.pdf",
    model="lightonocr-2-1b",
    format="markdown",
    pages="1-3"
)

print(document)
```

## Formats

There are two _types_ of formats that `omniocr` supports:

1. markdown conversion -- this is the simplest, the document is just converted to markdown, typically with placeholders for images
2. block-based output -- if you need bounding boxes for _where_ the text comes from, you should use a model that supports bounding box outputs

## Supported Models


