actum-ocr
Document image OCR via OpenAI vision. Extract plain text from JPEG / PNG / WebP.
Install
pip install actum-ocr
Local / editable (from this folder):
pip install -e .
# or build artifacts:
python -m build
pip install dist/actum_ocr-*.whl
Usage
import base64
from actum_ocr import extract_text_from_image, resolve_source_text, OcrError
with open("passport.jpg", "rb") as f:
b64 = base64.b64encode(f.read()).decode("ascii")
text = extract_text_from_image(b64, "image/jpeg")
# or: text, ocr_used = resolve_source_text(image_base64=b64, image_mime="image/jpeg")
Optional kwargs (override env):
extract_text_from_image(
b64,
"image/png",
api_key="sk-...",
model="gpt-4o-mini",
timeout=120,
detail="low", # low | high | auto
)
Environment
| Variable | Default | Purpose |
|---|---|---|
OPENAI_API_KEY |
— | Required unless api_key= is passed |
ACTUM_OCR_MODEL / ACTUM_MODEL |
gpt-4o-mini |
Vision model |
ACTUM_OCR_TIMEOUT |
120 |
Request timeout (seconds) |
ACTUM_OCR_DETAIL |
low |
Vision detail: low / high / auto |
Publish to PyPI
pip install build twine
python -m build
twine upload dist/*
For TestPyPI first:
twine upload --repository testpypi dist/*
pip install -i https://test.pypi.org/simple/ actum-ocr
API
ocr_available()— key present?decode_image(b64, mime)— validate + decodeextract_text_from_image(b64, mime, **opts)— OCR → textresolve_source_text(text=..., image_base64=..., image_mime=..., **opts)— image winsOcrError—.code,.message,.status_code
Metadata
Release files for actum-ocr 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| actum_ocr-0.1.0.tar.gz | 5.6 kB | Without provenance | Details for actum_ocr-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| actum_ocr-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for actum_ocr-0.1.0-py3-none-any.whl |
Total release size: 11.0 kB
Release files / actum_ocr-0.1.0.tar.gz
| Download URL | actum_ocr-0.1.0.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33df5171fb4e2c2e0e673922e80de19f3655a4091361575d09a1041996785cc6
|
|
BLAKE2b-256 checksum How to use checksums |
9393461a1140ff80f5f0a1e47c339380090285d9c324488f88e4cb4a577d0756
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / actum_ocr-0.1.0-py3-none-any.whl
| Download URL | actum_ocr-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6cf3a248b034df8c8885ce6726fd89fe8f600b000ac5351a003ab5d4059b034c
|
|
BLAKE2b-256 checksum How to use checksums |
0da3b31249b0986dc7bbea048adb70d38cf92d9cfc1db1fe30cc7d7adb86ec71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for actum-ocr 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.