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
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.2.tar.gz
(5.3 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.2.tar.gz.
File metadata
- Download URL: omniocr-0.1.2.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae018c5780675a92c22f7ae1568f4b6922b128a64ba8583d9ead3422fcde2289
|
|
| MD5 |
af1fad78a22864da03f09596b0195376
|
|
| BLAKE2b-256 |
99581016b4b4bda73de09ec71897a4ae4d636033f596665efdaece07b2f3f7b5
|
File details
Details for the file omniocr-0.1.2-py3-none-any.whl.
File metadata
- Download URL: omniocr-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59d2e6ab2f437ce9577fa66497d1ea56a35dde6632dc12f1f7b6794ce4266585
|
|
| MD5 |
df2018294a172eb3db682ee836b998be
|
|
| BLAKE2b-256 |
1801ff89810c893ab3cf6deccc0e2584369a48f6f1e3f5d151ec12f7fff254d7
|