Skip to content

Commit 60e2628

Browse files
committed
📝 add sample code for all supported APIs
1 parent cb03354 commit 60e2628

35 files changed

+336
-4
lines changed

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
# so a file named "default.css" will overwrite the builtin "default.css".
5757
html_static_path = ["_static"]
5858

59+
# A list of paths that contain extra files not directly related to the documentation.
60+
html_extra_path = ["extras"]
61+
5962

6063
# -- autodoc -----------------------------------------------------------------
6164

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from mindee import Client, documents
2+
3+
# Init a new client and add your custom endpoint (document)
4+
mindee_client = Client(api_key="my-api-key").add_endpoint(
5+
account_name="my-account",
6+
endpoint_name="my-endpoint",
7+
)
8+
9+
# Load a file from disk and parse it.
10+
# The endpoint name must be specified since it can't be determined from the class.
11+
result = mindee_client.doc_from_path(
12+
"/path/to/the/file.ext"
13+
).parse(documents.TypeCustomV1, endpoint_name="my-endpoint")
14+
15+
# Print a brief summary of the parsed data
16+
print(result.document)
17+
18+
# Iterate over all the fields in the document
19+
for field_name, field_values in result.document.fields.items():
20+
print(field_name, "=", field_values)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from mindee import Client, documents
2+
3+
# Init a new client
4+
mindee_client = Client(api_key="my-api-key")
5+
6+
# Load a file from disk
7+
input_doc = mindee_client.doc_from_path("/path/to/the/file.ext")
8+
9+
# Parse the Financial Document by passing the appropriate type
10+
result = input_doc.parse(documents.TypeFinancialDocumentV1)
11+
12+
# Print a brief summary of the parsed data
13+
print(result.document)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from mindee import Client, documents
2+
3+
# Init a new client
4+
mindee_client = Client(api_key="my-api-key")
5+
6+
# Load a file from disk
7+
input_doc = mindee_client.doc_from_path("/path/to/the/file.ext")
8+
9+
# Parse the Bank Account Details by passing the appropriate type
10+
result = input_doc.parse(documents.fr.TypeBankAccountDetailsV1)
11+
12+
# Print a brief summary of the parsed data
13+
print(result.document)
File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from mindee import Client, documents
2+
3+
# Init a new client
4+
mindee_client = Client(api_key="my-api-key")
5+
6+
# Load a file from disk
7+
input_doc = mindee_client.doc_from_path("/path/to/the/file.ext")
8+
9+
# Parse the Invoice by passing the appropriate type
10+
result = input_doc.parse(documents.TypeInvoiceV3)
11+
12+
# Print a brief summary of the parsed data
13+
print(result.document)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from mindee import Client, documents
2+
3+
# Init a new client
4+
mindee_client = Client(api_key="my-api-key")
5+
6+
# Load a file from disk
7+
input_doc = mindee_client.doc_from_path("/path/to/the/file.ext")
8+
9+
# Parse the Invoice by passing the appropriate type
10+
result = input_doc.parse(documents.TypeInvoiceV4)
11+
12+
# Print a brief summary of the parsed data
13+
print(result.document)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from mindee import Client, documents
2+
3+
# Init a new client
4+
mindee_client = Client(api_key="my-api-key")
5+
6+
# Load a file from disk
7+
input_doc = mindee_client.doc_from_path("/path/to/the/file.ext")
8+
9+
# Parse the Passport by passing the appropriate type
10+
result = input_doc.parse(documents.TypePassportV1)
11+
12+
# Print a brief summary of the parsed data
13+
print(result.document)

0 commit comments

Comments
 (0)