Skip to main content

Mindee API helper library for python

Project description

Mindee API helper library for python

The full documentation is availabale here

Install

Install from PyPi using pip, a package manager for Python.

pip install mindee

Don't have pip installed? Try installing it, by running this from the command line:

$ curl https://bootstrap.pypa.io/get-pip.py | python

Getting started with the Mindee API couldn't be easier. Create a Client and you're ready to go.

Create your Client

The mindee.Client needs your API credentials. You can either pass these directly to the constructor (see the code below) or via environment variables.

Depending on what type of document you want to parse, you need to add specifics auth token for each endpoint.

from mindee import Client

mindee_client = Client(
    expense_receipts_token="your_expense_receipts_api_token_here",
    invoice_token="your_invoice_api_token_here",
    passport_token="your_passport_api_token_here",
    license_plate_token="your_license_plate_api_token_here",
    raise_on_error=True
)

We suggest storing your credentials as environment variables. Why? You'll never have to worry about committing your credentials and accidentally posting them somewhere public.

Parsing methods

# Call the receipt parsing API and create a receipt object under parsed_data.receipt
parsed_data = mindee_client.parse_receipt("/path/to/file")

# Call the invoice parsing API and create an invoice object under parsed_data.invoice
parsed_data = mindee_client.parse_invoice("/path/to/file")

# If you have a mixed data flow of invoice and receipt, use financial_document class
# Call the invoice or receipt parsing API according to your input data type
# and create a FinancialDocument object under parsed_data.financial_document
parsed_data = mindee_client.parse_financial_document("/path/to/file")

# Call the passport parsing API and create a Passport object under parsed_data.passport
parsed_data = mindee_client.parse_passport("/path/to/file")

# Call the license_plates parsing API and create a CarPlate object under parsed_data.license_plate
parsed_data = mindee_client.parse_license_plate("/path/to/file")

Input data

You can pass your input file in three ways:

From file path

receipt_data = mindee_client.parse_receipt('/path/to/file', input_type="path")

From a file object

with open('/path/to/file', 'rb') as fp:
     receipt_data = mindee_client.parse_receipt(fp, input_type="file")

From a base64

receipt_data = mindee_client.parse_receipt(base64_string, input_type="base64")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mindee-1.0.0.tar.gz (128.7 kB view details)

Uploaded Source

Built Distribution

mindee-1.0.0-py3-none-any.whl (152.8 kB view details)

Uploaded Python 3

File details

Details for the file mindee-1.0.0.tar.gz.

File metadata

  • Download URL: mindee-1.0.0.tar.gz
  • Upload date:
  • Size: 128.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.9

File hashes

Hashes for mindee-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b90440bb2983bf6789f9d33a9e487f9cca471b334327616f72f2ca4ee5bf7fc9
MD5 f1b7c4aaf0e7850a7d5166782700a0c5
BLAKE2b-256 ca8e69f44e0f8999c9c9b6a4e6c4afcb4b64030ebfc562a675f4df4075443b9d

See more details on using hashes here.

File details

Details for the file mindee-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mindee-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 152.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.9

File hashes

Hashes for mindee-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da3cdf5226c7eef6aacbb2c30737a4c78484a0455cfbb5f8a29ad4f939d1c8d0
MD5 2d10ce5df45a1cf540b52e389b0de7c0
BLAKE2b-256 ee2ac1e98442fbc613ee4e5785eb783ec61e66e0db3e48658f49d13695289021

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page