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

Python OCR SDK

Mindee API Helper Library for Python

Quickly and easily connect to Mindee's API services using Python.

Quick Start

Here's the TL;DR of getting started.

First, get an API Key

Then, install this library:

pip install mindee

Finally, Python away!

Loading a File and Parsing It

Global Documents

from mindee import Client, product, PathInput

# Init a new client
mindee_client = Client(api_key="my-api-key")

# Load a file from disk
input_source = PathInput("/path/to/the/file.ext")

# Parse the document as an invoice by passing the appropriate type
result = mindee_client.parse(product.InvoiceV4, input_source)

# Print a brief summary of the parsed data
print(result.document)

Note: Files can also be loaded from:

A python BinaryIO compatible file:

A URL (HTTPS only):

A base64-encoded string, making sure to specify the extension of the file name:

Raw bytes, making sure to specify the extension of the file name:

Region-Specific Documents

Additional Options

Options to pass when sending a file.

Page Options

Allows sending only certain pages in a PDF.

In this example we only send the first, penultimate and last pages:

Further Reading

You can view the source code on GitHub.

You can also take a look at the Reference Documentation.

License

Copyright © Mindee

Available as open source under the terms of the MIT License.

Last updated

Was this helpful?