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.0.tar.gz
(4.1 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.0.tar.gz.
File metadata
- Download URL: omniocr-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d30ce5962f756727fb1ceb084025db975c90109e663abfffa1160f572a72c2d
|
|
| MD5 |
f381f1693a391d8bc3c18c854ebf5686
|
|
| BLAKE2b-256 |
b5e6a6689816c37fa0e549be1651aac11f8c98f5986ab92fb07031dfc886a8b9
|
File details
Details for the file omniocr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: omniocr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58d87529d392c9bbc4fdbad3c33170f5712171340b0faf216d5906e46577bbb8
|
|
| MD5 |
7448ce285898648447ecb1a828088283
|
|
| BLAKE2b-256 |
2dadc3aca31a858db0b11fb53b120a7cb87264cd3c682f9bf5ef9702b6aa3d0c
|