Python SDK

Integrate perfectly into your PyTorch/Jupyter workflow with one pip install.

pip install solveocr

Documentation

Authentication

Set your API key via an environment variable, or pass it directly.

import solveocr
import os

os.environ["SOLVEOCR_API_KEY"] = "sk-..."
client = solveocr.Client()

Extract Data

The `extract` method accepts standard file paths, raw bytes, or PIL Image objects.

res = client.extract("invoice.pdf")

print(res.text)
print(res.language)
print(res.bounding_boxes)  # Returns numpy array of shape (N, 4)
Plays nice with numpy and pandas!
Content-Length: 0