mindee 3.16.0 → 3.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/bin/mindee.rb +20 -2
- data/docs/code_samples/{international_id_v1_async.txt → driver_license_v1_async.txt} +1 -1
- data/docs/code_samples/french_healthcard_v1_async.txt +19 -0
- data/docs/code_samples/payslip_fra_v3_async.txt +19 -0
- data/docs/code_samples/workflow_execution.txt +29 -0
- data/docs/driver_license_v1.md +156 -0
- data/docs/{carte_vitale_v1.md → french_healthcard_v1.md} +14 -24
- data/docs/payslip_fra_v3.md +319 -0
- data/lib/mindee/client.rb +40 -0
- data/lib/mindee/http/workflow_endpoint.rb +90 -0
- data/lib/mindee/http.rb +1 -0
- data/lib/mindee/parsing/common/api_response.rb +22 -1
- data/lib/mindee/parsing/common/execution.rb +73 -0
- data/lib/mindee/parsing/common/execution_file.rb +24 -0
- data/lib/mindee/parsing/common/execution_priority.rb +30 -0
- data/lib/mindee/parsing/common.rb +3 -0
- data/lib/mindee/product/{international_id/international_id_v1.rb → driver_license/driver_license_v1.rb} +9 -9
- data/lib/mindee/product/driver_license/driver_license_v1_document.rb +91 -0
- data/lib/mindee/product/{international_id/international_id_v1_page.rb → driver_license/driver_license_v1_page.rb} +7 -7
- data/lib/mindee/product/fr/health_card/health_card_v1.rb +41 -0
- data/lib/mindee/product/fr/health_card/health_card_v1_document.rb +52 -0
- data/lib/mindee/product/fr/health_card/health_card_v1_page.rb +34 -0
- data/lib/mindee/product/fr/payslip/payslip_v3.rb +41 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rb +54 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_document.rb +166 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_employee.rb +78 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_employer.rb +78 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_employment.rb +78 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_page.rb +34 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb +89 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_pay_detail.rb +100 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_pay_period.rb +66 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_salary_detail.rb +89 -0
- data/lib/mindee/product/resume/resume_v1_document.rb +1 -1
- data/lib/mindee/product/resume/resume_v1_page.rb +1 -1
- data/lib/mindee/product.rb +3 -1
- data/lib/mindee/version.rb +1 -1
- metadata +30 -10
- data/docs/eu_driver_license_v1.md +0 -227
- data/docs/proof_of_address_v1.md +0 -211
- data/docs/us_driver_license_v1.md +0 -272
- data/lib/mindee/product/international_id/international_id_v1_document.rb +0 -109
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12e0bc8339961d2e6be4c5dfdc9537d34ab63f449c435275324b95c031299764
|
4
|
+
data.tar.gz: 24021ef9d0175075365efc9e056d67f3d553b1ad7b95a5a2876d29fcff15031c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df5dc07d28d67b0e1fe1c64c3123aeb3f9c8926264aed396fdd64858f8b06d6d2485745c61d15c35e0ae3f92ee6773eaacbdc86ba3256cefd7349fb0ff90533a
|
7
|
+
data.tar.gz: e07e7b776f21398ce3a9197fb54afef57361ffda29c198564da9ffa1fa0eea85830c7d1601177c241219bea60c61cbb9cbcec66ad0c80d55ffcc7aab0e8cfe4f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Mindee Ruby API Library Changelog
|
2
2
|
|
3
|
+
## v3.17.0 - 2024-11-28
|
4
|
+
### Changes
|
5
|
+
* :sparkles: add support for workflows
|
6
|
+
* :sparkles: add support for French Health Card V1
|
7
|
+
* :sparkles: add support for Driver License V1
|
8
|
+
* :sparkles: add support for Payslip FR V3
|
9
|
+
* :coffin: remove support for international ID V1
|
10
|
+
|
3
11
|
## v3.16.0 - 2024-11-14
|
4
12
|
### Changes
|
5
13
|
* :sparkles: add support for business cards V1
|
data/bin/mindee.rb
CHANGED
@@ -41,7 +41,7 @@ DOCUMENTS = {
|
|
41
41
|
description: 'Invoice',
|
42
42
|
doc_class: Mindee::Product::Invoice::InvoiceV4,
|
43
43
|
sync: true,
|
44
|
-
async:
|
44
|
+
async: true,
|
45
45
|
},
|
46
46
|
"international-id" => {
|
47
47
|
description: 'International Id',
|
@@ -53,7 +53,13 @@ DOCUMENTS = {
|
|
53
53
|
description: "Expense Receipt",
|
54
54
|
doc_class: Mindee::Product::Receipt::ReceiptV5,
|
55
55
|
sync: true,
|
56
|
-
async:
|
56
|
+
async: true,
|
57
|
+
},
|
58
|
+
"driver-license" => {
|
59
|
+
description: "Driver License",
|
60
|
+
doc_class: Mindee::Product::DriverLicense::DriverLicenseV1,
|
61
|
+
sync: false,
|
62
|
+
async: true,
|
57
63
|
},
|
58
64
|
"resume" => {
|
59
65
|
description: "Resume",
|
@@ -103,6 +109,18 @@ DOCUMENTS = {
|
|
103
109
|
sync: true,
|
104
110
|
async: false,
|
105
111
|
},
|
112
|
+
"fr-health-card" => {
|
113
|
+
description: "FR Health Card",
|
114
|
+
doc_class: Mindee::Product::FR::HealthCard::HealthCardV1,
|
115
|
+
sync: false,
|
116
|
+
async: true,
|
117
|
+
},
|
118
|
+
"fr-payslip" => {
|
119
|
+
description: "FR Payslip",
|
120
|
+
doc_class: Mindee::Product::FR::Payslip::PayslipV3,
|
121
|
+
sync: false,
|
122
|
+
async: true,
|
123
|
+
},
|
106
124
|
"us-bank-check" => {
|
107
125
|
description: "US Bank Check",
|
108
126
|
doc_class: Mindee::Product::US::BankCheck::BankCheckV1,
|
@@ -9,7 +9,7 @@ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
|
9
9
|
# Parse the file
|
10
10
|
result = mindee_client.enqueue_and_parse(
|
11
11
|
input_source,
|
12
|
-
Mindee::Product::
|
12
|
+
Mindee::Product::DriverLicense::DriverLicenseV1
|
13
13
|
)
|
14
14
|
|
15
15
|
# Print a full summary of the parsed data in RST format
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'mindee'
|
2
|
+
|
3
|
+
# Init a new client
|
4
|
+
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
5
|
+
|
6
|
+
# Load a file from disk
|
7
|
+
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
8
|
+
|
9
|
+
# Parse the file
|
10
|
+
result = mindee_client.enqueue_and_parse(
|
11
|
+
input_source,
|
12
|
+
Mindee::Product::FR::HealthCard::HealthCardV1
|
13
|
+
)
|
14
|
+
|
15
|
+
# Print a full summary of the parsed data in RST format
|
16
|
+
puts result.document
|
17
|
+
|
18
|
+
# Print the document-level parsed data
|
19
|
+
# puts result.document.inference.prediction
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'mindee'
|
2
|
+
|
3
|
+
# Init a new client
|
4
|
+
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
5
|
+
|
6
|
+
# Load a file from disk
|
7
|
+
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
8
|
+
|
9
|
+
# Parse the file
|
10
|
+
result = mindee_client.enqueue_and_parse(
|
11
|
+
input_source,
|
12
|
+
Mindee::Product::FR::Payslip::PayslipV3
|
13
|
+
)
|
14
|
+
|
15
|
+
# Print a full summary of the parsed data in RST format
|
16
|
+
puts result.document
|
17
|
+
|
18
|
+
# Print the document-level parsed data
|
19
|
+
# puts result.document.inference.prediction
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'mindee'
|
2
|
+
|
3
|
+
workflow_id = 'workflow-id'
|
4
|
+
|
5
|
+
# Init a new client
|
6
|
+
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
7
|
+
|
8
|
+
# Load a file from disk
|
9
|
+
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
10
|
+
|
11
|
+
# Send the file to the workflow
|
12
|
+
result = mindee_client.execute_workflow(
|
13
|
+
input_source,
|
14
|
+
workflow_id
|
15
|
+
)
|
16
|
+
|
17
|
+
# Alternatively, set an alias & a priority for the execution.
|
18
|
+
# result = mindee_client.execute_workflow(
|
19
|
+
# input_source,
|
20
|
+
# workflow_id,
|
21
|
+
# document_alias: "my-alias",
|
22
|
+
# priority: Mindee::Parsing::Common::ExecutionPriority::LOW
|
23
|
+
# )
|
24
|
+
|
25
|
+
# Print the execution's ID to make sure it worked
|
26
|
+
puts result.execution.id
|
27
|
+
|
28
|
+
# Print the inference, if present
|
29
|
+
# puts result.document.inference
|
@@ -0,0 +1,156 @@
|
|
1
|
+
---
|
2
|
+
title: Driver License OCR Ruby
|
3
|
+
category: 622b805aaec68102ea7fcbc2
|
4
|
+
slug: ruby-driver-license-ocr
|
5
|
+
parentDoc: 6294d97ee723f1008d2ab28e
|
6
|
+
---
|
7
|
+
The Ruby OCR SDK supports the [Driver License API](https://platform.mindee.com/mindee/driver_license).
|
8
|
+
|
9
|
+
The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/driver_license/default_sample.jpg) can be used for testing purposes.
|
10
|
+

|
11
|
+
|
12
|
+
# Quick-Start
|
13
|
+
```rb
|
14
|
+
require 'mindee'
|
15
|
+
|
16
|
+
# Init a new client
|
17
|
+
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
18
|
+
|
19
|
+
# Load a file from disk
|
20
|
+
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
21
|
+
|
22
|
+
# Parse the file
|
23
|
+
result = mindee_client.enqueue_and_parse(
|
24
|
+
input_source,
|
25
|
+
Mindee::Product::DriverLicense::DriverLicenseV1
|
26
|
+
)
|
27
|
+
|
28
|
+
# Print a full summary of the parsed data in RST format
|
29
|
+
puts result.document
|
30
|
+
|
31
|
+
# Print the document-level parsed data
|
32
|
+
# puts result.document.inference.prediction
|
33
|
+
|
34
|
+
```
|
35
|
+
# Field Types
|
36
|
+
## Standard Fields
|
37
|
+
These fields are generic and used in several products.
|
38
|
+
|
39
|
+
### Basic Field
|
40
|
+
Each prediction object contains a set of fields that inherit from the generic `Field` class.
|
41
|
+
A typical `Field` object will have the following attributes:
|
42
|
+
|
43
|
+
* **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
|
44
|
+
* **confidence** (Float, nil): the confidence score of the field prediction.
|
45
|
+
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
46
|
+
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
47
|
+
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
48
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
49
|
+
|
50
|
+
|
51
|
+
Aside from the previous attributes, all basic fields have access to a `to_s` method that can be used to print their value as a string.
|
52
|
+
|
53
|
+
### Date Field
|
54
|
+
Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
|
55
|
+
|
56
|
+
* **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
|
57
|
+
|
58
|
+
### String Field
|
59
|
+
The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
|
60
|
+
|
61
|
+
# Attributes
|
62
|
+
The following fields are extracted for Driver License V1:
|
63
|
+
|
64
|
+
## Category
|
65
|
+
**category** ([StringField](#string-field)): The category or class of the driver license.
|
66
|
+
|
67
|
+
```rb
|
68
|
+
puts result.document.inference.prediction.category.value
|
69
|
+
```
|
70
|
+
|
71
|
+
## Country Code
|
72
|
+
**country_code** ([StringField](#string-field)): The alpha-3 ISO 3166 code of the country where the driver license was issued.
|
73
|
+
|
74
|
+
```rb
|
75
|
+
puts result.document.inference.prediction.country_code.value
|
76
|
+
```
|
77
|
+
|
78
|
+
## Date of Birth
|
79
|
+
**date_of_birth** ([DateField](#date-field)): The date of birth of the driver license holder.
|
80
|
+
|
81
|
+
```rb
|
82
|
+
puts result.document.inference.prediction.date_of_birth.value
|
83
|
+
```
|
84
|
+
|
85
|
+
## DD Number
|
86
|
+
**dd_number** ([StringField](#string-field)): The DD number of the driver license.
|
87
|
+
|
88
|
+
```rb
|
89
|
+
puts result.document.inference.prediction.dd_number.value
|
90
|
+
```
|
91
|
+
|
92
|
+
## Expiry Date
|
93
|
+
**expiry_date** ([DateField](#date-field)): The expiry date of the driver license.
|
94
|
+
|
95
|
+
```rb
|
96
|
+
puts result.document.inference.prediction.expiry_date.value
|
97
|
+
```
|
98
|
+
|
99
|
+
## First Name
|
100
|
+
**first_name** ([StringField](#string-field)): The first name of the driver license holder.
|
101
|
+
|
102
|
+
```rb
|
103
|
+
puts result.document.inference.prediction.first_name.value
|
104
|
+
```
|
105
|
+
|
106
|
+
## ID
|
107
|
+
**id** ([StringField](#string-field)): The unique identifier of the driver license.
|
108
|
+
|
109
|
+
```rb
|
110
|
+
puts result.document.inference.prediction.id.value
|
111
|
+
```
|
112
|
+
|
113
|
+
## Issued Date
|
114
|
+
**issued_date** ([DateField](#date-field)): The date when the driver license was issued.
|
115
|
+
|
116
|
+
```rb
|
117
|
+
puts result.document.inference.prediction.issued_date.value
|
118
|
+
```
|
119
|
+
|
120
|
+
## Issuing Authority
|
121
|
+
**issuing_authority** ([StringField](#string-field)): The authority that issued the driver license.
|
122
|
+
|
123
|
+
```rb
|
124
|
+
puts result.document.inference.prediction.issuing_authority.value
|
125
|
+
```
|
126
|
+
|
127
|
+
## Last Name
|
128
|
+
**last_name** ([StringField](#string-field)): The last name of the driver license holder.
|
129
|
+
|
130
|
+
```rb
|
131
|
+
puts result.document.inference.prediction.last_name.value
|
132
|
+
```
|
133
|
+
|
134
|
+
## MRZ
|
135
|
+
**mrz** ([StringField](#string-field)): The Machine Readable Zone (MRZ) of the driver license.
|
136
|
+
|
137
|
+
```rb
|
138
|
+
puts result.document.inference.prediction.mrz.value
|
139
|
+
```
|
140
|
+
|
141
|
+
## Place of Birth
|
142
|
+
**place_of_birth** ([StringField](#string-field)): The place of birth of the driver license holder.
|
143
|
+
|
144
|
+
```rb
|
145
|
+
puts result.document.inference.prediction.place_of_birth.value
|
146
|
+
```
|
147
|
+
|
148
|
+
## State
|
149
|
+
**state** ([StringField](#string-field)): Second part of the ISO 3166-2 code, consisting of two letters indicating the US State.
|
150
|
+
|
151
|
+
```rb
|
152
|
+
puts result.document.inference.prediction.state.value
|
153
|
+
```
|
154
|
+
|
155
|
+
# Questions?
|
156
|
+
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
|
@@ -1,13 +1,13 @@
|
|
1
1
|
---
|
2
|
-
title: FR
|
2
|
+
title: FR Health Card OCR Ruby
|
3
3
|
category: 622b805aaec68102ea7fcbc2
|
4
|
-
slug: ruby-fr-
|
4
|
+
slug: ruby-fr-health-card-ocr
|
5
5
|
parentDoc: 6294d97ee723f1008d2ab28e
|
6
6
|
---
|
7
|
-
The Ruby OCR SDK supports the [
|
7
|
+
The Ruby OCR SDK supports the [Health Card API](https://platform.mindee.com/mindee/french_healthcard).
|
8
8
|
|
9
|
-
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/
|
10
|
-
, we are going to illustrate how to extract the data that we want using the OCR SDK.
|
10
|
+

|
11
11
|
|
12
12
|
# Quick-Start
|
13
13
|
```rb
|
@@ -20,9 +20,9 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
|
20
20
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
21
21
|
|
22
22
|
# Parse the file
|
23
|
-
result = mindee_client.
|
23
|
+
result = mindee_client.enqueue_and_parse(
|
24
24
|
input_source,
|
25
|
-
Mindee::Product::FR::
|
25
|
+
Mindee::Product::FR::HealthCard::HealthCardV1
|
26
26
|
)
|
27
27
|
|
28
28
|
# Print a full summary of the parsed data in RST format
|
@@ -38,29 +38,19 @@ puts result.document
|
|
38
38
|
########
|
39
39
|
Document
|
40
40
|
########
|
41
|
-
:Mindee ID:
|
41
|
+
:Mindee ID: 9ee2733d-933a-4dcd-a73a-a31395e3b288
|
42
42
|
:Filename: default_sample.jpg
|
43
43
|
|
44
44
|
Inference
|
45
45
|
#########
|
46
|
-
:Product: mindee/
|
46
|
+
:Product: mindee/french_healthcard v1.0
|
47
47
|
:Rotation applied: Yes
|
48
48
|
|
49
49
|
Prediction
|
50
50
|
==========
|
51
51
|
:Given Name(s): NATHALIE
|
52
52
|
:Surname: DURAND
|
53
|
-
:Social Security Number:
|
54
|
-
:Issuance Date: 2007-01-01
|
55
|
-
|
56
|
-
Page Predictions
|
57
|
-
================
|
58
|
-
|
59
|
-
Page 0
|
60
|
-
------
|
61
|
-
:Given Name(s): NATHALIE
|
62
|
-
:Surname: DURAND
|
63
|
-
:Social Security Number: 269054958815780
|
53
|
+
:Social Security Number: 2 69 05 49 588 157 80
|
64
54
|
:Issuance Date: 2007-01-01
|
65
55
|
```
|
66
56
|
|
@@ -91,10 +81,10 @@ Aside from the basic `Field` attributes, the date field `DateField` also impleme
|
|
91
81
|
The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
|
92
82
|
|
93
83
|
# Attributes
|
94
|
-
The following fields are extracted for
|
84
|
+
The following fields are extracted for Health Card V1:
|
95
85
|
|
96
86
|
## Given Name(s)
|
97
|
-
**given_names** (Array<[StringField](#string-field)>): The given
|
87
|
+
**given_names** (Array<[StringField](#string-field)>): The given names of the card holder.
|
98
88
|
|
99
89
|
```rb
|
100
90
|
for given_names_elem in result.document.inference.prediction.given_names do
|
@@ -103,14 +93,14 @@ end
|
|
103
93
|
```
|
104
94
|
|
105
95
|
## Issuance Date
|
106
|
-
**issuance_date** ([DateField](#date-field)): The date the
|
96
|
+
**issuance_date** ([DateField](#date-field)): The date when the carte vitale document was issued.
|
107
97
|
|
108
98
|
```rb
|
109
99
|
puts result.document.inference.prediction.issuance_date.value
|
110
100
|
```
|
111
101
|
|
112
102
|
## Social Security Number
|
113
|
-
**social_security** ([StringField](#string-field)): The
|
103
|
+
**social_security** ([StringField](#string-field)): The social security number of the card holder.
|
114
104
|
|
115
105
|
```rb
|
116
106
|
puts result.document.inference.prediction.social_security.value
|