Skip to content

Commit 197ced9

Browse files
✨ add support for us healthcare card and update products (#247)
1 parent a81e1da commit 197ced9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

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

docs/extras/code_samples/international_id_v2_async.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from mindee import Client, product, AsyncPredictResponse
2-
from time import sleep
32

43
# Init a new client
54
mindee_client = Client(api_key="my-api-key")

docs/extras/code_samples/material_certificate_v1_async.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from mindee import Client, product, AsyncPredictResponse
2-
from time import sleep
32

43
# Init a new client
54
mindee_client = Client(api_key="my-api-key")

docs/extras/code_samples/resume_v1_async.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from mindee import Client, product, AsyncPredictResponse
2-
from time import sleep
32

43
# Init a new client
54
mindee_client = Client(api_key="my-api-key")
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.us.HealthcareCardV1,
12+
input_doc,
13+
)
14+
15+
# Print a brief summary of the parsed data
16+
print(result.document)

docs/extras/guide/expense_receipts_v5.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ print(result.document)
3232
########
3333
Document
3434
########
35-
:Mindee ID: ce41e37a-65d8-4de1-b34b-1c92ab04b1ae
35+
:Mindee ID: d96fb043-8fb8-4adc-820c-387aae83376d
3636
:Filename: default_sample.jpg
3737
3838
Inference
3939
#########
40-
:Product: mindee/expense_receipts v5.0
40+
:Product: mindee/expense_receipts v5.3
4141
:Rotation applied: Yes
4242
4343
Prediction
@@ -58,11 +58,12 @@ Prediction
5858
+===============+========+==========+===============+
5959
| 8.50 | VAT | 20.00 | 1.70 |
6060
+---------------+--------+----------+---------------+
61-
:Supplier Name: CLACHAN
62-
:Supplier Company Registrations: 232153895
63-
232153895
64-
:Supplier Address: 34 kingley street w1b 5qh
61+
:Supplier Name: clachan
62+
:Supplier Company Registrations: Type: VAT NUMBER, Value: 232153895
63+
Type: VAT NUMBER, Value: 232153895
64+
:Supplier Address: 34 Kingley Street W1B 50H
6565
:Supplier Phone Number: 02074940834
66+
:Receipt Number: 54/7500
6667
:Line Items:
6768
+--------------------------------------+----------+--------------+------------+
6869
| Description | Quantity | Total Amount | Unit Price |
@@ -91,11 +92,12 @@ Page 0
9192
+===============+========+==========+===============+
9293
| 8.50 | VAT | 20.00 | 1.70 |
9394
+---------------+--------+----------+---------------+
94-
:Supplier Name: CLACHAN
95-
:Supplier Company Registrations: 232153895
96-
232153895
97-
:Supplier Address: 34 kingley street w1b 5qh
95+
:Supplier Name: clachan
96+
:Supplier Company Registrations: Type: VAT NUMBER, Value: 232153895
97+
Type: VAT NUMBER, Value: 232153895
98+
:Supplier Address: 34 Kingley Street W1B 50H
9899
:Supplier Phone Number: 02074940834
100+
:Receipt Number: 54/7500
99101
:Line Items:
100102
+--------------------------------------+----------+--------------+------------+
101103
| Description | Quantity | Total Amount | Unit Price |

docs/extras/guide/financial_document_v1.md

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,50 @@ print(result.document)
2525

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

3053
**Output (RST):**
3154
```rst
3255
########
3356
Document
3457
########
35-
:Mindee ID: 503895c6-eced-42e2-a6fc-0292b7ccf680
58+
:Mindee ID: 3859a462-e05f-4f4c-a736-febca66b9aa9
3659
:Filename: default_sample.jpg
3760
3861
Inference
3962
#########
40-
:Product: mindee/financial_document v1.6
63+
:Product: mindee/financial_document v1.9
4164
:Rotation applied: Yes
4265
4366
Prediction
4467
==========
45-
:Locale: en; USD;
68+
:Locale: en; en; USD;
4669
:Invoice Number: INT-001
70+
:Receipt Number:
71+
:Document Number: INT-001
4772
:Reference Numbers: 2412/2019
4873
:Purchase Date: 2019-11-02
4974
:Due Date: 2019-02-26
@@ -75,23 +100,25 @@ Prediction
75100
:Tip and Gratuity:
76101
:Purchase Time:
77102
:Line Items:
78-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
79-
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price |
80-
+======================================+==============+==========+============+==============+==============+============+
81-
| Front and rear brake cables | | 1.00 | | | 100.00 | 100.00 |
82-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
83-
| New set of pedal arms | | 2.00 | | | 50.00 | 25.00 |
84-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
85-
| Labor 3hrs | | 3.00 | | | 45.00 | 15.00 |
86-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
103+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
104+
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
105+
+======================================+==============+==========+============+==============+==============+=================+============+
106+
| Front and rear brake cables | | 1.00 | | | 100.00 | | 100.00 |
107+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
108+
| New set of pedal arms | | 2.00 | | | 50.00 | | 25.00 |
109+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
110+
| Labor 3hrs | | 3.00 | | | 45.00 | | 15.00 |
111+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
87112
88113
Page Predictions
89114
================
90115
91116
Page 0
92117
------
93-
:Locale: en; USD;
118+
:Locale: en; en; USD;
94119
:Invoice Number: INT-001
120+
:Receipt Number:
121+
:Document Number: INT-001
95122
:Reference Numbers: 2412/2019
96123
:Purchase Date: 2019-11-02
97124
:Due Date: 2019-02-26
@@ -123,15 +150,15 @@ Page 0
123150
:Tip and Gratuity:
124151
:Purchase Time:
125152
:Line Items:
126-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
127-
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price |
128-
+======================================+==============+==========+============+==============+==============+============+
129-
| Front and rear brake cables | | 1.00 | | | 100.00 | 100.00 |
130-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
131-
| New set of pedal arms | | 2.00 | | | 50.00 | 25.00 |
132-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
133-
| Labor 3hrs | | 3.00 | | | 45.00 | 15.00 |
134-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
153+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
154+
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
155+
+======================================+==============+==========+============+==============+==============+=================+============+
156+
| Front and rear brake cables | | 1.00 | | | 100.00 | | 100.00 |
157+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
158+
| New set of pedal arms | | 2.00 | | | 50.00 | | 25.00 |
159+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
160+
| Labor 3hrs | | 3.00 | | | 45.00 | | 15.00 |
161+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
135162
```
136163

137164
# Field Types
@@ -220,6 +247,7 @@ A `FinancialDocumentV1LineItem` implements the following attributes:
220247
* **tax_amount** (`float`): The item tax amount.
221248
* **tax_rate** (`float`): The item tax rate in percentage.
222249
* **total_amount** (`float`): The item total amount.
250+
* **unit_measure** (`str`): The item unit of measure.
223251
* **unit_price** (`float`): The item unit price.
224252

225253
# Attributes

docs/extras/guide/international_id_v2.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/mai
99
# Quick-Start
1010
```py
1111
from mindee import Client, product, AsyncPredictResponse
12-
from time import sleep
1312

1413
# Init a new client
1514
mindee_client = Client(api_key="my-api-key")

docs/extras/guide/invoices_v4.md

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

2626
# Print the document-level summary
2727
# print(result.document.inference.prediction)
28+
2829
```
2930

3031
**Output (RST):**
3132
```rst
3233
########
3334
Document
3435
########
35-
:Mindee ID: 5c0371d0-1433-43a4-b8fb-a3b11aaf9a0e
36+
:Mindee ID: 372d9d08-59d8-4e1c-9622-06648c1c238b
3637
:Filename: default_sample.jpg
3738
3839
Inference
3940
#########
40-
:Product: mindee/invoices v4.6
41+
:Product: mindee/invoices v4.7
4142
:Rotation applied: Yes
4243
4344
Prediction
@@ -47,7 +48,7 @@ Prediction
4748
:Reference Numbers: AD29094
4849
:Purchase Date: 2018-09-25
4950
:Due Date:
50-
:Total Net:
51+
:Total Net: 2145.00
5152
:Total Amount: 2608.20
5253
:Total Tax: 193.20
5354
:Taxes:
@@ -71,15 +72,15 @@ Prediction
7172
:Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
7273
:Document Type: INVOICE
7374
:Line Items:
74-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
75-
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price |
76-
+======================================+==============+==========+============+==============+==============+============+
77-
| Platinum web hosting package Down... | | 1.00 | | | 65.00 | 65.00 |
78-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
79-
| 2 page website design Includes ba... | | 3.00 | | | 2100.00 | 2100.00 |
80-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
81-
| Mobile designs Includes responsiv... | | 1.00 | | | 250.00 | 250.00 |
82-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
75+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
76+
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
77+
+======================================+==============+==========+============+==============+==============+=================+============+
78+
| Platinum web hosting package Down... | | 1.00 | | | 65.00 | | 65.00 |
79+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
80+
| 2 page website design Includes ba... | | 3.00 | | | 2100.00 | | 2100.00 |
81+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
82+
| Mobile designs Includes responsiv... | | 1.00 | | | 250.00 | 1 | 250.00 |
83+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
8384
8485
Page Predictions
8586
================
@@ -91,7 +92,7 @@ Page 0
9192
:Reference Numbers: AD29094
9293
:Purchase Date: 2018-09-25
9394
:Due Date:
94-
:Total Net:
95+
:Total Net: 2145.00
9596
:Total Amount: 2608.20
9697
:Total Tax: 193.20
9798
:Taxes:
@@ -115,15 +116,15 @@ Page 0
115116
:Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
116117
:Document Type: INVOICE
117118
:Line Items:
118-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
119-
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price |
120-
+======================================+==============+==========+============+==============+==============+============+
121-
| Platinum web hosting package Down... | | 1.00 | | | 65.00 | 65.00 |
122-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
123-
| 2 page website design Includes ba... | | 3.00 | | | 2100.00 | 2100.00 |
124-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
125-
| Mobile designs Includes responsiv... | | 1.00 | | | 250.00 | 250.00 |
126-
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
119+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
120+
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
121+
+======================================+==============+==========+============+==============+==============+=================+============+
122+
| Platinum web hosting package Down... | | 1.00 | | | 65.00 | | 65.00 |
123+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
124+
| 2 page website design Includes ba... | | 3.00 | | | 2100.00 | | 2100.00 |
125+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
126+
| Mobile designs Includes responsiv... | | 1.00 | | | 250.00 | 1 | 250.00 |
127+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
127128
```
128129

129130
# Field Types
@@ -212,6 +213,7 @@ A `InvoiceV4LineItem` implements the following attributes:
212213
* **tax_amount** (`float`): The item tax amount.
213214
* **tax_rate** (`float`): The item tax rate in percentage.
214215
* **total_amount** (`float`): The item total amount.
216+
* **unit_measure** (`str`): The item unit of measure.
215217
* **unit_price** (`float`): The item unit price.
216218

217219
# Attributes

docs/extras/guide/material_certificate_v1.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/prod
99
# Quick-Start
1010
```py
1111
from mindee import Client, product, AsyncPredictResponse
12-
from time import sleep
1312

1413
# Init a new client
1514
mindee_client = Client(api_key="my-api-key")

0 commit comments

Comments
 (0)