Run ~any open source OCR model behind a single API.
Project description
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:
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:
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:
- markdown conversion -- this is the simplest, the document is just converted to markdown, typically with placeholders for images
- 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
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
omniocr-0.1.1.tar.gz
(5.2 kB
view details)
Built Distribution
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 omniocr-0.1.1.tar.gz.
File metadata
- Download URL: omniocr-0.1.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8f85fc2c591b950619f4991ae5e48e18d8ef24ab99df16dcb0532f039d1f668
|
|
| MD5 |
26e27bfb9695db7bdffcaed72f00ad97
|
|
| BLAKE2b-256 |
ffdb768dbfe1d6d25c4612b2ca525f7ef1dbaa6a0fd3e12e89c6f26fde06ea99
|
File details
Details for the file omniocr-0.1.1-py3-none-any.whl.
File metadata
- Download URL: omniocr-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
254d6f352f57e1a41c29b1d16f758d430c8af4731b43ffe1eb0b5a497d85c15b
|
|
| MD5 |
10e35d74de0522104e472d211345feac
|
|
| BLAKE2b-256 |
e12670a869f39c40680b996ca19407461da2b6b35c9d5a29e917919544496f62
|