Skip to content

✨ add support for us healthcare card and update products #247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/extras/code_samples/financial_document_v1_async.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from mindee import Client, product, AsyncPredictResponse

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

# Load a file from disk
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")

# Load a file from disk and enqueue it.
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
product.FinancialDocumentV1,
input_doc,
)

# Print a brief summary of the parsed data
print(result.document)
1 change: 0 additions & 1 deletion docs/extras/code_samples/international_id_v2_async.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from mindee import Client, product, AsyncPredictResponse
from time import sleep

# Init a new client
mindee_client = Client(api_key="my-api-key")
Expand Down
1 change: 0 additions & 1 deletion docs/extras/code_samples/material_certificate_v1_async.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from mindee import Client, product, AsyncPredictResponse
from time import sleep

# Init a new client
mindee_client = Client(api_key="my-api-key")
Expand Down
1 change: 0 additions & 1 deletion docs/extras/code_samples/resume_v1_async.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from mindee import Client, product, AsyncPredictResponse
from time import sleep

# Init a new client
mindee_client = Client(api_key="my-api-key")
Expand Down
16 changes: 16 additions & 0 deletions docs/extras/code_samples/us_healthcare_cards_v1_async.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from mindee import Client, product, AsyncPredictResponse

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

# Load a file from disk
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")

# Load a file from disk and enqueue it.
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
product.us.HealthcareCardV1,
input_doc,
)

# Print a brief summary of the parsed data
print(result.document)
22 changes: 12 additions & 10 deletions docs/extras/guide/expense_receipts_v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ print(result.document)
########
Document
########
:Mindee ID: ce41e37a-65d8-4de1-b34b-1c92ab04b1ae
:Mindee ID: d96fb043-8fb8-4adc-820c-387aae83376d
:Filename: default_sample.jpg

Inference
#########
:Product: mindee/expense_receipts v5.0
:Product: mindee/expense_receipts v5.3
:Rotation applied: Yes

Prediction
Expand All @@ -58,11 +58,12 @@ Prediction
+===============+========+==========+===============+
| 8.50 | VAT | 20.00 | 1.70 |
+---------------+--------+----------+---------------+
:Supplier Name: CLACHAN
:Supplier Company Registrations: 232153895
232153895
:Supplier Address: 34 kingley street w1b 5qh
:Supplier Name: clachan
:Supplier Company Registrations: Type: VAT NUMBER, Value: 232153895
Type: VAT NUMBER, Value: 232153895
:Supplier Address: 34 Kingley Street W1B 50H
:Supplier Phone Number: 02074940834
:Receipt Number: 54/7500
:Line Items:
+--------------------------------------+----------+--------------+------------+
| Description | Quantity | Total Amount | Unit Price |
Expand Down Expand Up @@ -91,11 +92,12 @@ Page 0
+===============+========+==========+===============+
| 8.50 | VAT | 20.00 | 1.70 |
+---------------+--------+----------+---------------+
:Supplier Name: CLACHAN
:Supplier Company Registrations: 232153895
232153895
:Supplier Address: 34 kingley street w1b 5qh
:Supplier Name: clachan
:Supplier Company Registrations: Type: VAT NUMBER, Value: 232153895
Type: VAT NUMBER, Value: 232153895
:Supplier Address: 34 Kingley Street W1B 50H
:Supplier Phone Number: 02074940834
:Receipt Number: 54/7500
:Line Items:
+--------------------------------------+----------+--------------+------------+
| Description | Quantity | Total Amount | Unit Price |
Expand Down
72 changes: 50 additions & 22 deletions docs/extras/guide/financial_document_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,50 @@ print(result.document)

# Print the document-level summary
# print(result.document.inference.prediction)

```

You can also call this product asynchronously:

```py
from mindee import Client, product, AsyncPredictResponse

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

# Load a file from disk
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")

# Load a file from disk and enqueue it.
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
product.FinancialDocumentV1,
input_doc,
)

# Print a brief summary of the parsed data
print(result.document)

```

**Output (RST):**
```rst
########
Document
########
:Mindee ID: 503895c6-eced-42e2-a6fc-0292b7ccf680
:Mindee ID: 3859a462-e05f-4f4c-a736-febca66b9aa9
:Filename: default_sample.jpg

Inference
#########
:Product: mindee/financial_document v1.6
:Product: mindee/financial_document v1.9
:Rotation applied: Yes

Prediction
==========
:Locale: en; USD;
:Locale: en; en; USD;
:Invoice Number: INT-001
:Receipt Number:
:Document Number: INT-001
:Reference Numbers: 2412/2019
:Purchase Date: 2019-11-02
:Due Date: 2019-02-26
Expand Down Expand Up @@ -75,23 +100,25 @@ Prediction
:Tip and Gratuity:
:Purchase Time:
:Line Items:
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price |
+======================================+==============+==========+============+==============+==============+============+
| Front and rear brake cables | | 1.00 | | | 100.00 | 100.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
| New set of pedal arms | | 2.00 | | | 50.00 | 25.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
| Labor 3hrs | | 3.00 | | | 45.00 | 15.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
+======================================+==============+==========+============+==============+==============+=================+============+
| Front and rear brake cables | | 1.00 | | | 100.00 | | 100.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
| New set of pedal arms | | 2.00 | | | 50.00 | | 25.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
| Labor 3hrs | | 3.00 | | | 45.00 | | 15.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+

Page Predictions
================

Page 0
------
:Locale: en; USD;
:Locale: en; en; USD;
:Invoice Number: INT-001
:Receipt Number:
:Document Number: INT-001
:Reference Numbers: 2412/2019
:Purchase Date: 2019-11-02
:Due Date: 2019-02-26
Expand Down Expand Up @@ -123,15 +150,15 @@ Page 0
:Tip and Gratuity:
:Purchase Time:
:Line Items:
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price |
+======================================+==============+==========+============+==============+==============+============+
| Front and rear brake cables | | 1.00 | | | 100.00 | 100.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
| New set of pedal arms | | 2.00 | | | 50.00 | 25.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
| Labor 3hrs | | 3.00 | | | 45.00 | 15.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
+======================================+==============+==========+============+==============+==============+=================+============+
| Front and rear brake cables | | 1.00 | | | 100.00 | | 100.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
| New set of pedal arms | | 2.00 | | | 50.00 | | 25.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
| Labor 3hrs | | 3.00 | | | 45.00 | | 15.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
```

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

# Attributes
Expand Down
1 change: 0 additions & 1 deletion docs/extras/guide/international_id_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/mai
# Quick-Start
```py
from mindee import Client, product, AsyncPredictResponse
from time import sleep

# Init a new client
mindee_client = Client(api_key="my-api-key")
Expand Down
46 changes: 24 additions & 22 deletions docs/extras/guide/invoices_v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,20 @@ print(result.document)

# Print the document-level summary
# print(result.document.inference.prediction)

```

**Output (RST):**
```rst
########
Document
########
:Mindee ID: 5c0371d0-1433-43a4-b8fb-a3b11aaf9a0e
:Mindee ID: 372d9d08-59d8-4e1c-9622-06648c1c238b
:Filename: default_sample.jpg

Inference
#########
:Product: mindee/invoices v4.6
:Product: mindee/invoices v4.7
:Rotation applied: Yes

Prediction
Expand All @@ -47,7 +48,7 @@ Prediction
:Reference Numbers: AD29094
:Purchase Date: 2018-09-25
:Due Date:
:Total Net:
:Total Net: 2145.00
:Total Amount: 2608.20
:Total Tax: 193.20
:Taxes:
Expand All @@ -71,15 +72,15 @@ Prediction
:Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
:Document Type: INVOICE
:Line Items:
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price |
+======================================+==============+==========+============+==============+==============+============+
| Platinum web hosting package Down... | | 1.00 | | | 65.00 | 65.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
| 2 page website design Includes ba... | | 3.00 | | | 2100.00 | 2100.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
| Mobile designs Includes responsiv... | | 1.00 | | | 250.00 | 250.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
+======================================+==============+==========+============+==============+==============+=================+============+
| Platinum web hosting package Down... | | 1.00 | | | 65.00 | | 65.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
| 2 page website design Includes ba... | | 3.00 | | | 2100.00 | | 2100.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
| Mobile designs Includes responsiv... | | 1.00 | | | 250.00 | 1 | 250.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+

Page Predictions
================
Expand All @@ -91,7 +92,7 @@ Page 0
:Reference Numbers: AD29094
:Purchase Date: 2018-09-25
:Due Date:
:Total Net:
:Total Net: 2145.00
:Total Amount: 2608.20
:Total Tax: 193.20
:Taxes:
Expand All @@ -115,15 +116,15 @@ Page 0
:Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
:Document Type: INVOICE
:Line Items:
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price |
+======================================+==============+==========+============+==============+==============+============+
| Platinum web hosting package Down... | | 1.00 | | | 65.00 | 65.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
| 2 page website design Includes ba... | | 3.00 | | | 2100.00 | 2100.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
| Mobile designs Includes responsiv... | | 1.00 | | | 250.00 | 250.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+------------+
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
+======================================+==============+==========+============+==============+==============+=================+============+
| Platinum web hosting package Down... | | 1.00 | | | 65.00 | | 65.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
| 2 page website design Includes ba... | | 3.00 | | | 2100.00 | | 2100.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
| Mobile designs Includes responsiv... | | 1.00 | | | 250.00 | 1 | 250.00 |
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
```

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

# Attributes
Expand Down
1 change: 0 additions & 1 deletion docs/extras/guide/material_certificate_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/prod
# Quick-Start
```py
from mindee import Client, product, AsyncPredictResponse
from time import sleep

# Init a new client
mindee_client = Client(api_key="my-api-key")
Expand Down
1 change: 0 additions & 1 deletion docs/extras/guide/resume_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/mai
# Quick-Start
```py
from mindee import Client, product, AsyncPredictResponse
from time import sleep

# Init a new client
mindee_client = Client(api_key="my-api-key")
Expand Down
Loading
Loading