Skip to content

Commit 7357bfc

Browse files
📝 update documentation (#268)
1 parent 6237dc5 commit 7357bfc

File tree

5 files changed

+56
-10
lines changed

5 files changed

+56
-10
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.ReceiptV5,
12+
input_doc,
13+
)
14+
15+
# Print a brief summary of the parsed data
16+
print(result.document)

docs/extras/guide/energy_bill_fra_v1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ parentDoc: 609808f773b0b90051d839de
66
---
77
The Python OCR SDK supports the [Energy Bill API](https://platform.mindee.com/mindee/energy_bill_fra).
88

9-
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
10-
![Energy Bill sample](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.jpg?raw=true)
9+
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.pdf), we are going to illustrate how to extract the data that we want using the OCR SDK.
10+
![Energy Bill sample](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.pdf?raw=true)
1111

1212
# Quick-Start
1313
```py

docs/extras/guide/expense_receipts_v5.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,28 @@ print(result.document)
3131

3232
```
3333

34+
You can also call this product asynchronously:
35+
36+
```py
37+
from mindee import Client, product, AsyncPredictResponse
38+
39+
# Init a new client
40+
mindee_client = Client(api_key="my-api-key")
41+
42+
# Load a file from disk
43+
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")
44+
45+
# Load a file from disk and enqueue it.
46+
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
47+
product.ReceiptV5,
48+
input_doc,
49+
)
50+
51+
# Print a brief summary of the parsed data
52+
print(result.document)
53+
54+
```
55+
3456
**Output (RST):**
3557
```rst
3658
########
@@ -48,7 +70,7 @@ Prediction
4870
==========
4971
:Expense Locale: en-GB; en; GB; GBP;
5072
:Purchase Category: food
51-
:Purchase Subcategory:
73+
:Purchase Subcategory: restaurant
5274
:Document Type: EXPENSE RECEIPT
5375
:Purchase Date: 2016-02-26
5476
:Purchase Time: 15:20
@@ -82,7 +104,7 @@ Page 0
82104
------
83105
:Expense Locale: en-GB; en; GB; GBP;
84106
:Purchase Category: food
85-
:Purchase Subcategory:
107+
:Purchase Subcategory: restaurant
86108
:Document Type: EXPENSE RECEIPT
87109
:Purchase Date: 2016-02-26
88110
:Purchase Time: 15:20

docs/extras/guide/financial_document_v1.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,25 @@ print(result.document)
5858
########
5959
Document
6060
########
61-
:Mindee ID: 3859a462-e05f-4f4c-a736-febca66b9aa9
61+
:Mindee ID: 340ee4ae-b4da-41f0-b5ea-81ae29852b57
6262
:Filename: default_sample.jpg
6363
6464
Inference
6565
#########
66-
:Product: mindee/financial_document v1.9
66+
:Product: mindee/financial_document v1.10
6767
:Rotation applied: Yes
6868
6969
Prediction
7070
==========
7171
:Locale: en; en; USD;
7272
:Invoice Number: INT-001
73+
:Purchase Order Number: 2412/2019
7374
:Receipt Number:
7475
:Document Number: INT-001
7576
:Reference Numbers: 2412/2019
7677
:Purchase Date: 2019-11-02
7778
:Due Date: 2019-02-26
79+
:Payment Date: 2019-02-26
7880
:Total Net: 195.00
7981
:Total Amount: 204.75
8082
:Taxes:
@@ -120,11 +122,13 @@ Page 0
120122
------
121123
:Locale: en; en; USD;
122124
:Invoice Number: INT-001
125+
:Purchase Order Number: 2412/2019
123126
:Receipt Number:
124127
:Document Number: INT-001
125128
:Reference Numbers: 2412/2019
126129
:Purchase Date: 2019-11-02
127130
:Due Date: 2019-02-26
131+
:Payment Date: 2019-02-26
128132
:Total Net: 195.00
129133
:Total Amount: 204.75
130134
:Taxes:

docs/extras/guide/invoices_v4.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,23 @@ print(result.document)
5858
########
5959
Document
6060
########
61-
:Mindee ID: 372d9d08-59d8-4e1c-9622-06648c1c238b
61+
:Mindee ID: 651b6417-bc50-496e-aa81-207219f0b9f4
6262
:Filename: default_sample.jpg
6363
6464
Inference
6565
#########
66-
:Product: mindee/invoices v4.7
66+
:Product: mindee/invoices v4.8
6767
:Rotation applied: Yes
6868
6969
Prediction
7070
==========
7171
:Locale: en; en; CAD;
7272
:Invoice Number: 14
73+
:Purchase Order Number: AD29094
7374
:Reference Numbers: AD29094
7475
:Purchase Date: 2018-09-25
7576
:Due Date:
77+
:Payment Date:
7678
:Total Net: 2145.00
7779
:Total Amount: 2608.20
7880
:Total Tax: 193.20
@@ -88,7 +90,7 @@ Prediction
8890
:Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7
8991
:Supplier Phone Number: 4165551212
9092
:Supplier Website:
91-
:Supplier Email: ldoi@example.com
93+
:Supplier Email: j_coi@example.com
9294
:Customer Name: JIRO DOI
9395
:Customer Company Registrations:
9496
:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
@@ -114,9 +116,11 @@ Page 0
114116
------
115117
:Locale: en; en; CAD;
116118
:Invoice Number: 14
119+
:Purchase Order Number: AD29094
117120
:Reference Numbers: AD29094
118121
:Purchase Date: 2018-09-25
119122
:Due Date:
123+
:Payment Date:
120124
:Total Net: 2145.00
121125
:Total Amount: 2608.20
122126
:Total Tax: 193.20
@@ -132,7 +136,7 @@ Page 0
132136
:Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7
133137
:Supplier Phone Number: 4165551212
134138
:Supplier Website:
135-
:Supplier Email: ldoi@example.com
139+
:Supplier Email: j_coi@example.com
136140
:Customer Name: JIRO DOI
137141
:Customer Company Registrations:
138142
:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada

0 commit comments

Comments
 (0)