Skip to main content

Mindee API helper library for Python

Project description

License: MIT GitHub Workflow Status PyPI Version Downloads

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, documents

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

# Load a file from disk
input_doc = mindee_client.doc_from_path("/path/to/the/file.ext")

# Parse the document as an invoice by passing the appropriate type
result = input_doc.parse(documents.TypeInvoiceV4)

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

Region-Specific Documents

from mindee import Client, documents

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

# Load a file from disk
input_doc = mindee_client.doc_from_path("/path/to/the/file.ext")

# Parse the document as a USA bank check by passing the appropriate type
result = input_doc.parse(documents.us.TypeBankCheckV1)

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

Custom Document (API Builder)

from mindee import Client, documents

# Init a new client and add your custom endpoint (document)
mindee_client = Client(api_key="my-api-key").add_endpoint(
    account_name="john",
    endpoint_name="wnine",
)

# Load a file from disk and parse it.
# The endpoint name must be specified since it can't be determined from the class.
result = mindee_client.doc_from_path(
    "/path/to/the/file.ext"
).parse(documents.TypeCustomV1, endpoint_name="wnine")

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

# Iterate over all the fields in the document
for field_name, field_values in result.document.fields.items():
    print(field_name, "=", field_values)

Further Reading

Complete details on the working of the library are available in the following guides:

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.

Questions?

Join our Slack

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-3.11.0.tar.gz (62.8 kB view details)

Uploaded Source

Built Distribution

mindee-3.11.0-py3-none-any.whl (76.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mindee-3.11.0.tar.gz
  • Upload date:
  • Size: 62.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for mindee-3.11.0.tar.gz
Algorithm Hash digest
SHA256 aa45eff2e402792d572e490d2079ec791e74182919d82107d4d5a41f6f001601
MD5 2de7599779190a27fa7fcb9943c4b8bd
BLAKE2b-256 ecd6d2ed863c26d2cfff23720c1f2266d13c6003cb48e2ce3d920779b0c048d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mindee-3.11.0-py3-none-any.whl
  • Upload date:
  • Size: 76.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for mindee-3.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05945b2b35dfe6b01fe6075b6edaf4f0a71ebcb4e83f194e0909d3fbd23a53a3
MD5 1ef01b745414fd8a9f534d9b7ac7bd00
BLAKE2b-256 16914b8f235d1cac8b4632fde549408513ade94514819e00ff62f49dc7f223d9

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