Mindee API helper library for Python
Project description
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
api_response = input_doc.parse(documents.TypeInvoiceV4)
# Print a brief summary of the parsed data
print(api_response.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
api_response = input_doc.parse(documents.us.TypeBankCheckV1)
# Print a brief summary of the parsed data
print(api_response.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.
api_response = 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(api_response.document)
# Iterate over all the fields in the document
for field_name, field_values in api_response.document.fields.items():
print(field_name, "=", field_values)
Further Reading
There's more to it than that for those that need more features, or want to customize the experience.
All the juicy details are described in the Official Guide.
You can also take a look at the Reference Documentation.
License
Copyright © Mindee
Available as open source under the terms of the MIT License.
Project details
Release history Release notifications | RSS feed
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.2.0.tar.gz
(38.0 kB
view details)
Built Distribution
mindee-3.2.0-py3-none-any.whl
(47.7 kB
view details)
File details
Details for the file mindee-3.2.0.tar.gz
.
File metadata
- Download URL: mindee-3.2.0.tar.gz
- Upload date:
- Size: 38.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0158c449aee1a3572a9377f779c5e6f04dd85f7f17fd6c5c49324eba8f4c3051 |
|
MD5 | 4c1cb0866d5df6c11b3720daf947e48f |
|
BLAKE2b-256 | 11ad7be77deee8d4193b05be38287aaffaf606696e5d7b073d59f8f69b781279 |
File details
Details for the file mindee-3.2.0-py3-none-any.whl
.
File metadata
- Download URL: mindee-3.2.0-py3-none-any.whl
- Upload date:
- Size: 47.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d017ae93914f2be6d299ab6c70add97553ac99c5f6b208ebef958e43496ff9b |
|
MD5 | a742a6ac97e6e15711e2c0e7b26b0770 |
|
BLAKE2b-256 | 20b559d91a0850c37f38a30e653e0210b0ff3f35523f770fb869a0ecc8893c6c |