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
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:
- Getting started
- Command Line Interface (CLI)
- Custom APIs (API Builder)
- Invoice API
- Passport API
- Receipt API
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?
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.7.0.tar.gz
(53.5 kB
view details)
Built Distribution
mindee-3.7.0-py3-none-any.whl
(63.9 kB
view details)
File details
Details for the file mindee-3.7.0.tar.gz
.
File metadata
- Download URL: mindee-3.7.0.tar.gz
- Upload date:
- Size: 53.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aee27dcc7174d329295a0aabf833613e9a30eb9f74479fe674ff2ceb4ca88f53 |
|
MD5 | 5880ecb224c06a1271560b59c8363b13 |
|
BLAKE2b-256 | 47bec76c37d1d18b7d355651670a87916e9fe5d4e96435336415d537f0f56eb0 |
File details
Details for the file mindee-3.7.0-py3-none-any.whl
.
File metadata
- Download URL: mindee-3.7.0-py3-none-any.whl
- Upload date:
- Size: 63.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2440868b0e3f64e0292d901866d9e3d8a86b1be5a52e47d2ca680842b3cb2972 |
|
MD5 | 2e53745a364454f651cac2c80aacb63d |
|
BLAKE2b-256 | 6459ac167c080ef15596b75876d81ca160858f84decc27d6ca33fe48836fe7d1 |