Skip to content

Commit 7ca1672

Browse files
♻️ add async invoice call & update doc (#251)
1 parent eb75930 commit 7ca1672

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from mindee import Client, product, AsyncPredictResponse
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.source_from_path("/path/to/the/file.ext")
8+
9+
# Load a file from disk and enqueue it.
10+
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
11+
product.InvoiceV4,
12+
input_doc,
13+
)
14+
15+
# Print a brief summary of the parsed data
16+
print(result.document)

docs/extras/guide/financial_document_v1.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ print(result.document)
2525

2626
# Print the document-level summary
2727
# print(result.document.inference.prediction)
28-
2928
```
3029

3130
You can also call this product asynchronously:
@@ -47,7 +46,6 @@ result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
4746

4847
# Print a brief summary of the parsed data
4948
print(result.document)
50-
5149
```
5250

5351
**Output (RST):**

docs/extras/guide/invoices_v4.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,27 @@ print(result.document)
2525

2626
# Print the document-level summary
2727
# print(result.document.inference.prediction)
28+
```
29+
30+
You can also call this product asynchronously:
31+
32+
```py
33+
from mindee import Client, product, AsyncPredictResponse
34+
35+
# Init a new client
36+
mindee_client = Client(api_key="my-api-key")
37+
38+
# Load a file from disk
39+
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")
40+
41+
# Load a file from disk and enqueue it.
42+
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
43+
product.InvoiceV4,
44+
input_doc,
45+
)
2846

47+
# Print a brief summary of the parsed data
48+
print(result.document)
2949
```
3050

3151
**Output (RST):**

0 commit comments

Comments
 (0)