Skip to content

Commit

Permalink
✨ add support for financial document v1.10 & invoice v4.8 (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianMindee authored Oct 11, 2024
1 parent e0cd332 commit 17c597f
Show file tree
Hide file tree
Showing 14 changed files with 342 additions and 14 deletions.
51 changes: 50 additions & 1 deletion docs/extras/guide/bill_of_lading_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parentDoc: 609808f773b0b90051d839de
---
The Python OCR SDK supports the [Bill of Lading API](https://platform.mindee.com/mindee/bill_of_lading).

The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg) can be used for testing purposes.
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
![Bill of Lading sample](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg?raw=true)

# Quick-Start
Expand All @@ -29,6 +29,55 @@ result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
print(result.document)

```

**Output (RST):**
```rst
########
Document
########
:Mindee ID: 3b5250a1-b52c-4e0b-bc3e-2f0146b04e29
:Filename: default_sample.jpg
Inference
#########
:Product: mindee/bill_of_lading v1.1
:Rotation applied: No
Prediction
==========
:Bill of Lading Number: XYZ123456
:Shipper:
:Address: 123 OCEAN DRIVE, SHANGHAI, CHINA
:Email:
:Name: GLOBAL FREIGHT SOLUTIONS INC.
:Phone: 86-21-12345678
:Consignee:
:Address: 789 TRADE STREET, SINGAPORE 567890, SINGAPORE
:Email:
:Name: PACIFIC TRADING CO.
:Phone: 65-65432100
:Notify Party:
:Address: 789 TRADE STREET, SINGAPORE 567890, SINGAPORE
:Email:
:Name: PACIFIC TRADING CO.
:Phone: 65-65432100
:Carrier:
:Name: GLOBAL SHIPPING CO.,LTD.
:Professional Number:
:SCAC:
:Items:
+--------------------------------------+--------------+-------------+------------------+----------+-------------+
| Description | Gross Weight | Measurement | Measurement Unit | Quantity | Weight Unit |
+======================================+==============+=============+==================+==========+=============+
| ELECTRONIC COMPONENTS\nP/N: 12345... | 500.00 | 1.50 | cbm | 1.00 | kgs |
+--------------------------------------+--------------+-------------+------------------+----------+-------------+
:Port of Loading: SHANGHAI, CHINA
:Port of Discharge: LOS ANGELES, USA
:Place of Delivery: LOS ANGELES, USA
:Date of issue: 2022-09-30
:Departure Date:
```

# Field Types
## Standard Fields
These fields are generic and used in several products.
Expand Down
62 changes: 61 additions & 1 deletion docs/extras/guide/energy_bill_fra_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parentDoc: 609808f773b0b90051d839de
---
The Python OCR SDK supports the [Energy Bill API](https://platform.mindee.com/mindee/energy_bill_fra).

The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.jpg) can be used for testing purposes.
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.
![Energy Bill sample](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.jpg?raw=true)

# Quick-Start
Expand All @@ -29,6 +29,66 @@ result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
print(result.document)

```

**Output (RST):**
```rst
########
Document
########
:Mindee ID: 17f0ccef-e3fe-4a28-838d-d704489d6ce7
:Filename: default_sample.pdf
Inference
#########
:Product: mindee/energy_bill_fra v1.0
:Rotation applied: No
Prediction
==========
:Invoice Number: 10123590373
:Contract ID: 1234567890
:Delivery Point: 98765432109876
:Invoice Date: 2021-01-29
:Due Date: 2021-02-15
:Total Before Taxes: 1241.03
:Total Taxes: 238.82
:Total Amount: 1479.85
:Energy Supplier:
:Address: TSA 12345, 12345 DEMOCITY CEDEX, 75001 PARIS
:Name: EDF
:Energy Consumer:
:Address: 12 AVENUE DES RÊVES, RDC A 123 COUR FAUSSE A, 75000 PARIS
:Name: John Doe
:Subscription:
+--------------------------------------+------------+------------+----------+-----------+------------+
| Description | End Date | Start Date | Tax Rate | Total | Unit Price |
+======================================+============+============+==========+===========+============+
| Abonnement électricité | 2021-02-28 | 2021-01-01 | 5.50 | 59.00 | 29.50 |
+--------------------------------------+------------+------------+----------+-----------+------------+
:Energy Usage:
+--------------------------------------+------------+------------+----------+-----------+------------+
| Description | End Date | Start Date | Tax Rate | Total | Unit Price |
+======================================+============+============+==========+===========+============+
| Consommation (HT) | 2021-01-27 | 2020-11-28 | 20.00 | 898.43 | 10.47 |
+--------------------------------------+------------+------------+----------+-----------+------------+
:Taxes and Contributions:
+--------------------------------------+------------+------------+----------+-----------+------------+
| Description | End Date | Start Date | Tax Rate | Total | Unit Price |
+======================================+============+============+==========+===========+============+
| Contribution au Service Public de... | 2021-01-27 | 2020-11-28 | 20.00 | 193.07 | 2.25 |
+--------------------------------------+------------+------------+----------+-----------+------------+
| Départementale sur la Conso Final... | 2020-12-31 | 2020-11-28 | 20.00 | 13.98 | 0.3315 |
+--------------------------------------+------------+------------+----------+-----------+------------+
| Communale sur la Conso Finale Ele... | 2021-01-27 | 2021-01-01 | 20.00 | 28.56 | 0.6545 |
+--------------------------------------+------------+------------+----------+-----------+------------+
| Contribution Tarifaire d'Achemine... | 2020-12-31 | 2020-11-28 | 20.00 | 27.96 | 0.663 |
+--------------------------------------+------------+------------+----------+-----------+------------+
:Meter Details:
:Meter Number: 620
:Meter Type: electricity
:Unit of Measure: kWh
```

# Field Types
## Standard Fields
These fields are generic and used in several products.
Expand Down
8 changes: 4 additions & 4 deletions docs/extras/guide/expense_receipts_v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Prediction
==========
:Expense Locale: en-GB; en; GB; GBP;
:Purchase Category: food
:Purchase Subcategory: restaurant
:Purchase Subcategory:
:Document Type: EXPENSE RECEIPT
:Purchase Date: 2016-02-26
:Purchase Time: 15:20
Expand All @@ -62,7 +62,7 @@ Prediction
+===============+========+==========+===============+
| 8.50 | VAT | 20.00 | 1.70 |
+---------------+--------+----------+---------------+
:Supplier Name: clachan
:Supplier Name: Clachan
:Supplier Company Registrations: Type: VAT NUMBER, Value: 232153895
Type: VAT NUMBER, Value: 232153895
:Supplier Address: 34 Kingley Street W1B 50H
Expand All @@ -82,7 +82,7 @@ Page 0
------
:Expense Locale: en-GB; en; GB; GBP;
:Purchase Category: food
:Purchase Subcategory: restaurant
:Purchase Subcategory:
:Document Type: EXPENSE RECEIPT
:Purchase Date: 2016-02-26
:Purchase Time: 15:20
Expand All @@ -96,7 +96,7 @@ Page 0
+===============+========+==========+===============+
| 8.50 | VAT | 20.00 | 1.70 |
+---------------+--------+----------+---------------+
:Supplier Name: clachan
:Supplier Name: Clachan
:Supplier Company Registrations: Type: VAT NUMBER, Value: 232153895
Type: VAT NUMBER, Value: 232153895
:Supplier Address: 34 Kingley Street W1B 50H
Expand Down
14 changes: 14 additions & 0 deletions docs/extras/guide/financial_document_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,20 @@ for line_items_elem in result.document.inference.prediction.line_items:
print(result.document.inference.prediction.locale.value)
```

## Payment Date
**payment_date** ([DateField](#datefield)): The date on which the payment is due / fullfilled.

```py
print(result.document.inference.prediction.payment_date.value)
```

## Purchase Order Number
**po_number** ([StringField](#stringfield)): The purchase order number.

```py
print(result.document.inference.prediction.po_number.value)
```

## Receipt Number
**receipt_number** ([StringField](#stringfield)): The receipt number or identifier only if document is a receipt.

Expand Down
18 changes: 16 additions & 2 deletions docs/extras/guide/invoices_v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Prediction
:Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7
:Supplier Phone Number: 4165551212
:Supplier Website:
:Supplier Email: i_doi@example.com
:Supplier Email: ldoi@example.com
:Customer Name: JIRO DOI
:Customer Company Registrations:
:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
Expand Down Expand Up @@ -132,7 +132,7 @@ Page 0
:Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7
:Supplier Phone Number: 4165551212
:Supplier Website:
:Supplier Email: i_doi@example.com
:Supplier Email: ldoi@example.com
:Customer Name: JIRO DOI
:Customer Company Registrations:
:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
Expand Down Expand Up @@ -327,6 +327,20 @@ for line_items_elem in result.document.inference.prediction.line_items:
print(result.document.inference.prediction.locale.value)
```

## Payment Date
**payment_date** ([DateField](#datefield)): The date on which the payment is due/ was full-filled.

```py
print(result.document.inference.prediction.payment_date.value)
```

## Purchase Order Number
**po_number** ([StringField](#stringfield)): The purchase order number.

```py
print(result.document.inference.prediction.po_number.value)
```

## Reference Numbers
**reference_numbers** (List[[StringField](#stringfield)]): List of Reference numbers, including PO number.

Expand Down
81 changes: 80 additions & 1 deletion docs/extras/guide/nutrition_facts_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parentDoc: 609808f773b0b90051d839de
---
The Python OCR SDK supports the [Nutrition Facts Label API](https://platform.mindee.com/mindee/nutrition_facts).

The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/nutrition_facts/default_sample.jpg) can be used for testing purposes.
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/nutrition_facts/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
![Nutrition Facts Label sample](https://github.com/mindee/client-lib-test-data/blob/main/products/nutrition_facts/default_sample.jpg?raw=true)

# Quick-Start
Expand All @@ -29,6 +29,85 @@ result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
print(result.document)

```

**Output (RST):**
```rst
########
Document
########
:Mindee ID: 38a12fe0-5d69-4ca4-9b30-12f1b659311c
:Filename: default_sample.jpg
Inference
#########
:Product: mindee/nutrition_facts v1.0
:Rotation applied: No
Prediction
==========
:Serving per Box: 2.00
:Serving Size:
:Amount: 228.00
:Unit: g
:Calories:
:Daily Value:
:Per 100g:
:Per Serving: 250.00
:Total Fat:
:Daily Value:
:Per 100g:
:Per Serving: 12.00
:Saturated Fat:
:Daily Value: 15.00
:Per 100g:
:Per Serving: 3.00
:Trans Fat:
:Daily Value:
:Per 100g:
:Per Serving: 3.00
:Cholesterol:
:Daily Value: 10.00
:Per 100g:
:Per Serving: 30.00
:Total Carbohydrate:
:Daily Value: 10.00
:Per 100g:
:Per Serving: 31.00
:Dietary Fiber:
:Daily Value: 0.00
:Per 100g:
:Per Serving: 0.00
:Total Sugars:
:Daily Value:
:Per 100g:
:Per Serving: 5.00
:Added Sugars:
:Daily Value:
:Per 100g:
:Per Serving:
:Protein:
:Daily Value:
:Per 100g:
:Per Serving: 5.00
:sodium:
:Daily Value: 20.00
:Per 100g:
:Per Serving: 470.00
:Unit: mg
:nutrients:
+-------------+----------------------+----------+-------------+------+
| Daily Value | Name | Per 100g | Per Serving | Unit |
+=============+======================+==========+=============+======+
| 12.00 | Vitamin A | | 4.00 | mcg |
+-------------+----------------------+----------+-------------+------+
| 12.00 | Vitamin C | | 2.00 | mg |
+-------------+----------------------+----------+-------------+------+
| 12.00 | Calcium | | 45.60 | mg |
+-------------+----------------------+----------+-------------+------+
| 12.00 | Iron | | 0.90 | mg |
+-------------+----------------------+----------+-------------+------+
```

# Field Types
## Standard Fields
These fields are generic and used in several products.
Expand Down
Loading

0 comments on commit 17c597f

Please sign in to comment.