For the complete documentation index, see llms.txt. This page is also available as Markdown.

OCR Quick Start

Integrate an OCR Model.

Install the Client Library

Install the Mindee Client Library for your language or framework of choice

Requires Python ≥ 3.9. Python ≥ 3.11 is recommended.

Simply install the PyPi package using pip:

pip install -U mindee~=4.36

Don't see support for your favorite language or framework? Make a feature request!

Send a File and Poll

Use the client library to send the file to your OCR Model and return the result.

Requires Python ≥ 3.9. Python ≥ 3.11 is recommended. Requires the Mindee Python SDK version 4.35.1 or greater.

from mindee import (
    ClientV2,
    PathInput,
    OCRParameters,
    OCRResponse,
)

input_path = "/path/to/the/file.ext"
api_key = "MY_API_KEY"
model_id = "MY_MODEL_ID"

# Init a new client
mindee_client = ClientV2(api_key)

# Set parameters
model_params = OCRParameters(
    # ID of the model, required.
    model_id=model_id,
)

# Load a file from disk
input_source = PathInput(input_path)

# Send for processing using polling
response = mindee_client.enqueue_and_get_result(
    OCRResponse,
    input_source,
    model_params,
)

# Print a brief summary of the parsed data
print(response.inference)

# Access the OCR result
pages: list = response.inference.result.pages

Also take a look at the OCR Result documentation.

Last updated

Was this helpful?