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.9.0.tar.gz
(59.6 kB
view details)
Built Distribution
mindee-3.9.0-py3-none-any.whl
(71.9 kB
view details)
File details
Details for the file mindee-3.9.0.tar.gz
.
File metadata
- Download URL: mindee-3.9.0.tar.gz
- Upload date:
- Size: 59.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf5bde28cd445200f40e618b923d405964684ef821a06270d8d0d220079da3b8 |
|
MD5 | 510264a12c12c6c7cc7a810a8de4cf21 |
|
BLAKE2b-256 | fb47076525e5339f7e8ae1cbc55583a72c25d0d042fa9550b5226d9eacf947fd |
File details
Details for the file mindee-3.9.0-py3-none-any.whl
.
File metadata
- Download URL: mindee-3.9.0-py3-none-any.whl
- Upload date:
- Size: 71.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 | ce486504f346bc16b93f8de09e0e28ec64b08f6bbc22a4ab1e7119b1a02d8119 |
|
MD5 | 9c31d8677bee6bad20a50387883499a5 |
|
BLAKE2b-256 | ea814b17e7af5ac6ac0ef406f03766a36d0b58d29cea9f23042638f3659abf9e |