Skip to content

Commit

Permalink
📝 update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianMindee committed Oct 30, 2024
1 parent 4da19fb commit 0f296d4
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 10 deletions.
21 changes: 21 additions & 0 deletions docs/code_samples/expense_receipts_v5_async.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const mindee = require("mindee");
// for TS or modules:
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });

// Load a file from disk
const inputSource = mindeeClient.docFromPath("/path/to/the/file.ext");

// Parse the file
const apiResponse = mindeeClient.enqueueAndParse(
mindee.product.ReceiptV5,
inputSource
);

// Handle the response Promise
apiResponse.then((resp) => {
// print a string summary
console.log(resp.document.toString());
});
4 changes: 2 additions & 2 deletions docs/energy_bill_fra_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ parentDoc: 609809574212d40077a040f1
---
The Node.js 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
```js
Expand Down
30 changes: 28 additions & 2 deletions docs/expense_receipts_v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,32 @@ apiResponse.then((resp) => {
});
```

You can also call this product asynchronously:

```js
const mindee = require("mindee");
// for TS or modules:
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });

// Load a file from disk
const inputSource = mindeeClient.docFromPath("/path/to/the/file.ext");

// Parse the file
const apiResponse = mindeeClient.enqueueAndParse(
mindee.product.ReceiptV5,
inputSource
);

// Handle the response Promise
apiResponse.then((resp) => {
// print a string summary
console.log(resp.document.toString());
});
```

**Output (RST):**
```rst
########
Expand All @@ -51,7 +77,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 @@ -85,7 +111,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/financial_document_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,25 @@ apiResponse.then((resp) => {
########
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 @@ -127,11 +129,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/invoices_v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,23 @@ apiResponse.then((resp) => {
########
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 @@ -95,7 +97,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 @@ -121,9 +123,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 @@ -139,7 +143,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 0f296d4

Please sign in to comment.