Skip to content

Commit

Permalink
📝 update documentation (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianMindee authored Oct 30, 2024
1 parent 6237dc5 commit 7357bfc
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 10 deletions.
16 changes: 16 additions & 0 deletions docs/extras/code_samples/expense_receipts_v5_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.ReceiptV5,
input_doc,
)

# Print a brief summary of the parsed data
print(result.document)
4 changes: 2 additions & 2 deletions docs/extras/guide/energy_bill_fra_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ parentDoc: 609808f773b0b90051d839de
---
The Python OCR SDK supports the [Energy Bill API](https://platform.mindee.com/mindee/energy_bill_fra).

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)
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.
![Energy Bill sample](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.pdf?raw=true)

# Quick-Start
```py
Expand Down
26 changes: 24 additions & 2 deletions docs/extras/guide/expense_receipts_v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,28 @@ print(result.document)

```

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.ReceiptV5,
input_doc,
)

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

```

**Output (RST):**
```rst
########
Expand All @@ -48,7 +70,7 @@ Prediction
==========
:Expense Locale: en-GB; en; GB; GBP;
:Purchase Category: food
:Purchase Subcategory:
:Purchase Subcategory: restaurant
:Document Type: EXPENSE RECEIPT
:Purchase Date: 2016-02-26
:Purchase Time: 15:20
Expand Down Expand Up @@ -82,7 +104,7 @@ Page 0
------
:Expense Locale: en-GB; en; GB; GBP;
:Purchase Category: food
:Purchase Subcategory:
:Purchase Subcategory: restaurant
:Document Type: EXPENSE RECEIPT
:Purchase Date: 2016-02-26
:Purchase Time: 15:20
Expand Down
8 changes: 6 additions & 2 deletions docs/extras/guide/financial_document_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,25 @@ print(result.document)
########
Document
########
:Mindee ID: 3859a462-e05f-4f4c-a736-febca66b9aa9
:Mindee ID: 340ee4ae-b4da-41f0-b5ea-81ae29852b57
:Filename: default_sample.jpg
Inference
#########
:Product: mindee/financial_document v1.9
:Product: mindee/financial_document v1.10
:Rotation applied: Yes
Prediction
==========
:Locale: en; en; USD;
:Invoice Number: INT-001
:Purchase Order Number: 2412/2019
:Receipt Number:
:Document Number: INT-001
:Reference Numbers: 2412/2019
:Purchase Date: 2019-11-02
:Due Date: 2019-02-26
:Payment Date: 2019-02-26
:Total Net: 195.00
:Total Amount: 204.75
:Taxes:
Expand Down Expand Up @@ -120,11 +122,13 @@ Page 0
------
:Locale: en; en; USD;
:Invoice Number: INT-001
:Purchase Order Number: 2412/2019
:Receipt Number:
:Document Number: INT-001
:Reference Numbers: 2412/2019
:Purchase Date: 2019-11-02
:Due Date: 2019-02-26
:Payment Date: 2019-02-26
:Total Net: 195.00
:Total Amount: 204.75
:Taxes:
Expand Down
12 changes: 8 additions & 4 deletions docs/extras/guide/invoices_v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,23 @@ print(result.document)
########
Document
########
:Mindee ID: 372d9d08-59d8-4e1c-9622-06648c1c238b
:Mindee ID: 651b6417-bc50-496e-aa81-207219f0b9f4
:Filename: default_sample.jpg
Inference
#########
:Product: mindee/invoices v4.7
:Product: mindee/invoices v4.8
:Rotation applied: Yes
Prediction
==========
:Locale: en; en; CAD;
:Invoice Number: 14
:Purchase Order Number: AD29094
:Reference Numbers: AD29094
:Purchase Date: 2018-09-25
:Due Date:
:Payment Date:
:Total Net: 2145.00
:Total Amount: 2608.20
:Total Tax: 193.20
Expand All @@ -88,7 +90,7 @@ Prediction
:Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7
:Supplier Phone Number: 4165551212
:Supplier Website:
:Supplier Email: ldoi@example.com
:Supplier Email: j_coi@example.com
:Customer Name: JIRO DOI
:Customer Company Registrations:
:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
Expand All @@ -114,9 +116,11 @@ Page 0
------
:Locale: en; en; CAD;
:Invoice Number: 14
:Purchase Order Number: AD29094
:Reference Numbers: AD29094
:Purchase Date: 2018-09-25
:Due Date:
:Payment Date:
:Total Net: 2145.00
:Total Amount: 2608.20
:Total Tax: 193.20
Expand All @@ -132,7 +136,7 @@ Page 0
:Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7
:Supplier Phone Number: 4165551212
:Supplier Website:
:Supplier Email: ldoi@example.com
:Supplier Email: j_coi@example.com
:Customer Name: JIRO DOI
:Customer Company Registrations:
:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
Expand Down

0 comments on commit 7357bfc

Please sign in to comment.