mindee 3.3.0 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/docs/bank_account_details_v2.md +1 -1
- data/docs/bank_check_v1.md +5 -2
- data/docs/barcode_reader_v1.md +1 -1
- data/docs/carte_grise_v1.md +1 -1
- data/docs/carte_vitale_v1.md +1 -1
- data/docs/cropper_v1.md +5 -2
- data/docs/expense_receipts_v5.md +2 -2
- data/docs/financial_document_v1.md +5 -2
- data/docs/idcard_fr_v2.md +1 -1
- data/docs/invoices_v4.md +14 -5
- data/docs/license_plates_v1.md +1 -1
- data/docs/multi_receipts_detector_v1.md +5 -2
- data/docs/passport_v1.md +1 -1
- data/docs/proof_of_address_v1.md +1 -1
- data/docs/us_driver_license_v1.md +1 -1
- data/docs/us_w9_v1.md +1 -1
- data/lib/mindee/client.rb +15 -10
- data/lib/mindee/parsing/standard/string_field.rb +8 -0
- data/lib/mindee/product/invoice/invoice_v4_document.rb +5 -0
- data/lib/mindee/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe1aef5bf5c30b3b599d426140de05074840a57f29800129359d647e7ee1bbd5
|
4
|
+
data.tar.gz: 43c93a85a9a6d65fcba85345d1410844b07b5ca7d49a8a8f2487ccd5adcf767f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eff5e3f90cb351664059c4d6dcf78b839dca0e463d0d09b1b4b15a963828355c372845b0806369c21d6b46ed3b2ce45fd199e0bf7aa4c874df3fc06cae569d22
|
7
|
+
data.tar.gz: cb724d0b07bc0a4729d288076b26221fb99fc74d146d181bdae578b95fa9a374ae7deb43e3bb8cadbf7a8d3e5d9e98ea6737c7917565e375668d1fc4e93f95e3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Mindee Ruby API Library Changelog
|
2
2
|
|
3
|
+
## v3.4.0 - 2024-01-30
|
4
|
+
### Changes
|
5
|
+
* :arrow_up: update invoices to v4.4
|
6
|
+
* :sparkles: add support for `raw_value` in string fields
|
7
|
+
|
8
|
+
|
9
|
+
## v3.3.1 - 2023-12-15
|
10
|
+
### Changes
|
11
|
+
* :recycle: tweak async delays & retry
|
12
|
+
* :recycle: tweak default async sample delays & retry
|
13
|
+
* :memo: update md doc & fix typos
|
14
|
+
|
15
|
+
|
3
16
|
## v3.3.0 - 2023-11-17
|
4
17
|
### Changes
|
5
18
|
* :sparkles: add support for Carte Grise V1
|
@@ -81,7 +81,7 @@ A typical `Field` object will have the following attributes:
|
|
81
81
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
82
82
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
83
83
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
84
|
-
* **reconstructed** (`Boolean`): indicates whether
|
84
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
85
85
|
|
86
86
|
|
87
87
|
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.
|
data/docs/bank_check_v1.md
CHANGED
@@ -81,7 +81,7 @@ A typical `Field` object will have the following attributes:
|
|
81
81
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
82
82
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
83
83
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
84
|
-
* **reconstructed** (`Boolean`): indicates whether
|
84
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
85
85
|
|
86
86
|
|
87
87
|
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.
|
@@ -170,7 +170,10 @@ puts result.document.inference.prediction.routing_number.value
|
|
170
170
|
```rb
|
171
171
|
for page in result.document.inference.pages do
|
172
172
|
for signatures_positions_elem in page.prediction.signatures_positions do
|
173
|
-
puts signatures_positions_elem.polygon
|
173
|
+
puts signatures_positions_elem.polygon.to_s
|
174
|
+
puts signatures_positions_elem.quadrangle.to_s
|
175
|
+
puts signatures_positions_elem.rectangle.to_s
|
176
|
+
puts signatures_positions_elem.boundingBox.to_s
|
174
177
|
end
|
175
178
|
end
|
176
179
|
```
|
data/docs/barcode_reader_v1.md
CHANGED
@@ -71,7 +71,7 @@ A typical `Field` object will have the following attributes:
|
|
71
71
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
72
72
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
73
73
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
74
|
-
* **reconstructed** (`Boolean`): indicates whether
|
74
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
75
75
|
|
76
76
|
|
77
77
|
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.
|
data/docs/carte_grise_v1.md
CHANGED
@@ -147,7 +147,7 @@ A typical `Field` object will have the following attributes:
|
|
147
147
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
148
148
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
149
149
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
150
|
-
* **reconstructed** (`Boolean`): indicates whether
|
150
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
151
151
|
|
152
152
|
|
153
153
|
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.
|
data/docs/carte_vitale_v1.md
CHANGED
@@ -73,7 +73,7 @@ A typical `Field` object will have the following attributes:
|
|
73
73
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
74
74
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
75
75
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
76
|
-
* **reconstructed** (`Boolean`): indicates whether
|
76
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
77
77
|
|
78
78
|
|
79
79
|
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.
|
data/docs/cropper_v1.md
CHANGED
@@ -64,7 +64,7 @@ A typical `Field` object will have the following attributes:
|
|
64
64
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
65
65
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
66
66
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
67
|
-
* **reconstructed** (`Boolean`): indicates whether
|
67
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
68
68
|
|
69
69
|
|
70
70
|
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.
|
@@ -88,7 +88,10 @@ The following fields are extracted for Cropper V1:
|
|
88
88
|
```rb
|
89
89
|
for page in result.document.inference.pages do
|
90
90
|
for cropping_elem in page.prediction.cropping do
|
91
|
-
puts cropping_elem.polygon
|
91
|
+
puts cropping_elem.polygon.to_s
|
92
|
+
puts cropping_elem.quadrangle.to_s
|
93
|
+
puts cropping_elem.rectangle.to_s
|
94
|
+
puts cropping_elem.boundingBox.to_s
|
92
95
|
end
|
93
96
|
end
|
94
97
|
```
|
data/docs/expense_receipts_v5.md
CHANGED
@@ -119,7 +119,7 @@ A typical `Field` object will have the following attributes:
|
|
119
119
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
120
120
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
121
121
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
122
|
-
* **reconstructed** (`Boolean`): indicates whether
|
122
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
123
123
|
|
124
124
|
|
125
125
|
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.
|
@@ -263,7 +263,7 @@ puts result.document.inference.prediction.supplier_phone_number.value
|
|
263
263
|
|
264
264
|
```rb
|
265
265
|
for taxes_elem in result.document.inference.prediction.taxes do
|
266
|
-
puts taxes_elem.
|
266
|
+
puts taxes_elem.value
|
267
267
|
end
|
268
268
|
```
|
269
269
|
|
@@ -131,7 +131,7 @@ A typical `Field` object will have the following attributes:
|
|
131
131
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
132
132
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
133
133
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
134
|
-
* **reconstructed** (`Boolean`): indicates whether
|
134
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
135
135
|
|
136
136
|
|
137
137
|
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.
|
@@ -326,6 +326,9 @@ puts result.document.inference.prediction.supplier_name.value
|
|
326
326
|
```rb
|
327
327
|
for supplier_payment_details_elem in result.document.inference.prediction.supplier_payment_details do
|
328
328
|
puts supplier_payment_details_elem.value
|
329
|
+
puts supplier_payment_details_elem.rate
|
330
|
+
puts supplier_payment_details_elem.code
|
331
|
+
puts supplier_payment_details_elem.basis
|
329
332
|
end
|
330
333
|
```
|
331
334
|
|
@@ -341,7 +344,7 @@ puts result.document.inference.prediction.supplier_phone_number.value
|
|
341
344
|
|
342
345
|
```rb
|
343
346
|
for taxes_elem in result.document.inference.prediction.taxes do
|
344
|
-
puts taxes_elem.
|
347
|
+
puts taxes_elem.value
|
345
348
|
end
|
346
349
|
```
|
347
350
|
|
data/docs/idcard_fr_v2.md
CHANGED
@@ -99,7 +99,7 @@ A typical `Field` object will have the following attributes:
|
|
99
99
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
100
100
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
101
101
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
102
|
-
* **reconstructed** (`Boolean`): indicates whether
|
102
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
103
103
|
|
104
104
|
|
105
105
|
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.
|
data/docs/invoices_v4.md
CHANGED
@@ -34,12 +34,12 @@ puts result.document
|
|
34
34
|
########
|
35
35
|
Document
|
36
36
|
########
|
37
|
-
:Mindee ID:
|
37
|
+
:Mindee ID: 80f2328c-58a5-486a-9599-eb2d738680f0
|
38
38
|
:Filename: default_sample.jpg
|
39
39
|
|
40
40
|
Inference
|
41
41
|
#########
|
42
|
-
:Product: mindee/invoices v4.
|
42
|
+
:Product: mindee/invoices v4.4
|
43
43
|
:Rotation applied: Yes
|
44
44
|
|
45
45
|
Prediction
|
@@ -51,6 +51,7 @@ Prediction
|
|
51
51
|
:Due Date: 2018-09-25
|
52
52
|
:Total Net:
|
53
53
|
:Total Amount: 2608.20
|
54
|
+
:Total Tax: 193.20
|
54
55
|
:Taxes:
|
55
56
|
+---------------+--------+----------+---------------+
|
56
57
|
| Base | Code | Rate (%) | Amount |
|
@@ -58,7 +59,7 @@ Prediction
|
|
58
59
|
| | | 8.00 | 193.20 |
|
59
60
|
+---------------+--------+----------+---------------+
|
60
61
|
:Supplier Payment Details:
|
61
|
-
:Supplier Name: TURNPIKE DESIGNS
|
62
|
+
:Supplier Name: TURNPIKE DESIGNS
|
62
63
|
:Supplier Company Registrations:
|
63
64
|
:Supplier Address: 156 University Ave, Toronto ON, Canada M5H 2H7
|
64
65
|
:Customer Name: JIRO DOI
|
@@ -88,6 +89,7 @@ Page 0
|
|
88
89
|
:Due Date: 2018-09-25
|
89
90
|
:Total Net:
|
90
91
|
:Total Amount: 2608.20
|
92
|
+
:Total Tax: 193.20
|
91
93
|
:Taxes:
|
92
94
|
+---------------+--------+----------+---------------+
|
93
95
|
| Base | Code | Rate (%) | Amount |
|
@@ -95,7 +97,7 @@ Page 0
|
|
95
97
|
| | | 8.00 | 193.20 |
|
96
98
|
+---------------+--------+----------+---------------+
|
97
99
|
:Supplier Payment Details:
|
98
|
-
:Supplier Name: TURNPIKE DESIGNS
|
100
|
+
:Supplier Name: TURNPIKE DESIGNS
|
99
101
|
:Supplier Company Registrations:
|
100
102
|
:Supplier Address: 156 University Ave, Toronto ON, Canada M5H 2H7
|
101
103
|
:Customer Name: JIRO DOI
|
@@ -127,7 +129,7 @@ A typical `Field` object will have the following attributes:
|
|
127
129
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
128
130
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
129
131
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
130
|
-
* **reconstructed** (`Boolean`): indicates whether
|
132
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
131
133
|
|
132
134
|
|
133
135
|
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.
|
@@ -334,5 +336,12 @@ puts result.document.inference.prediction.total_amount.value
|
|
334
336
|
puts result.document.inference.prediction.total_net.value
|
335
337
|
```
|
336
338
|
|
339
|
+
## Total Tax
|
340
|
+
**total_tax** ([AmountField](#amount-field)): The total tax: includes all the taxes paid for this invoice.
|
341
|
+
|
342
|
+
```rb
|
343
|
+
puts result.document.inference.prediction.total_tax.value
|
344
|
+
```
|
345
|
+
|
337
346
|
# Questions?
|
338
347
|
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
|
data/docs/license_plates_v1.md
CHANGED
@@ -67,7 +67,7 @@ A typical `Field` object will have the following attributes:
|
|
67
67
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
68
68
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
69
69
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
70
|
-
* **reconstructed** (`Boolean`): indicates whether
|
70
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
71
71
|
|
72
72
|
|
73
73
|
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.
|
@@ -77,7 +77,7 @@ A typical `Field` object will have the following attributes:
|
|
77
77
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
78
78
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
79
79
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
80
|
-
* **reconstructed** (`Boolean`): indicates whether
|
80
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
81
81
|
|
82
82
|
|
83
83
|
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.
|
@@ -97,7 +97,10 @@ The following fields are extracted for Multi Receipts Detector V1:
|
|
97
97
|
|
98
98
|
```rb
|
99
99
|
for receipts_elem in result.document.inference.prediction.receipts do
|
100
|
-
puts receipts_elem.polygon
|
100
|
+
puts receipts_elem.polygon.to_s
|
101
|
+
puts receipts_elem.quadrangle.to_s
|
102
|
+
puts receipts_elem.rectangle.to_s
|
103
|
+
puts receipts_elem.boundingBox.to_s
|
101
104
|
end
|
102
105
|
```
|
103
106
|
|
data/docs/passport_v1.md
CHANGED
@@ -87,7 +87,7 @@ A typical `Field` object will have the following attributes:
|
|
87
87
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
88
88
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
89
89
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
90
|
-
* **reconstructed** (`Boolean`): indicates whether
|
90
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
91
91
|
|
92
92
|
|
93
93
|
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.
|
data/docs/proof_of_address_v1.md
CHANGED
@@ -105,7 +105,7 @@ A typical `Field` object will have the following attributes:
|
|
105
105
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
106
106
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
107
107
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
108
|
-
* **reconstructed** (`Boolean`): indicates whether
|
108
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
109
109
|
|
110
110
|
|
111
111
|
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.
|
@@ -101,7 +101,7 @@ A typical `Field` object will have the following attributes:
|
|
101
101
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
102
102
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
103
103
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
104
|
-
* **reconstructed** (`Boolean`): indicates whether
|
104
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
105
105
|
|
106
106
|
|
107
107
|
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.
|
data/docs/us_w9_v1.md
CHANGED
@@ -74,7 +74,7 @@ A typical `Field` object will have the following attributes:
|
|
74
74
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
75
75
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
76
76
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
77
|
-
* **reconstructed** (`Boolean`): indicates whether
|
77
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
78
78
|
|
79
79
|
|
80
80
|
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.
|
data/lib/mindee/client.rb
CHANGED
@@ -137,9 +137,9 @@ module Mindee
|
|
137
137
|
# * `:on_min_pages` Apply the operation only if document has at least this many pages.
|
138
138
|
# @param cropper [Boolean, nil] Whether to include cropper results for each page.
|
139
139
|
# This performs a cropping operation on the server and will increase response time.
|
140
|
-
# @param initial_delay_sec [Integer, Float, nil] initial delay before polling. Defaults to
|
141
|
-
# @param delay_sec [Integer, Float, nil] delay between polling attempts. Defaults to
|
142
|
-
# @param max_retries [Integer, nil] maximum amount of retries. Defaults to
|
140
|
+
# @param initial_delay_sec [Integer, Float, nil] initial delay before polling. Defaults to 4.
|
141
|
+
# @param delay_sec [Integer, Float, nil] delay between polling attempts. Defaults to 2.
|
142
|
+
# @param max_retries [Integer, nil] maximum amount of retries. Defaults to 30.
|
143
143
|
# @return [Mindee::Parsing::Common::ApiResponse]
|
144
144
|
def enqueue_and_parse(
|
145
145
|
input_source,
|
@@ -149,9 +149,9 @@ module Mindee
|
|
149
149
|
close_file: true,
|
150
150
|
page_options: nil,
|
151
151
|
cropper: false,
|
152
|
-
initial_delay_sec:
|
153
|
-
delay_sec:
|
154
|
-
max_retries:
|
152
|
+
initial_delay_sec: 4,
|
153
|
+
delay_sec: 2,
|
154
|
+
max_retries: 30
|
155
155
|
)
|
156
156
|
enqueue_res = enqueue(
|
157
157
|
input_source,
|
@@ -243,11 +243,16 @@ module Mindee
|
|
243
243
|
# Validates the parameters for async auto-polling
|
244
244
|
# @param initial_delay_sec [Integer, Float] initial delay before polling
|
245
245
|
# @param delay_sec [Integer, Float] delay between polling attempts
|
246
|
-
# @param max_retries [Integer, nil] maximum amount of retries.
|
246
|
+
# @param max_retries [Integer, nil] maximum amount of retries.
|
247
247
|
def validate_async_params(initial_delay_sec, delay_sec, max_retries)
|
248
|
-
|
249
|
-
|
250
|
-
|
248
|
+
min_delay_sec = 1
|
249
|
+
min_initial_delay_sec = 2
|
250
|
+
min_retries = 2
|
251
|
+
raise "Cannot set auto-poll delay to less than #{min_delay_sec} seconds" if delay_sec < min_delay_sec
|
252
|
+
if initial_delay_sec < min_initial_delay_sec
|
253
|
+
raise "Cannot set initial parsing delay to less than #{min_initial_delay_sec} seconds"
|
254
|
+
end
|
255
|
+
raise "Cannot set auto-poll delay to less than #{min_retries} seconds" if max_retries < min_retries
|
251
256
|
end
|
252
257
|
|
253
258
|
# Creates an endpoint with the given values. Raises an error if the endpoint is invalid.
|
@@ -10,6 +10,14 @@ module Mindee
|
|
10
10
|
# Value as String
|
11
11
|
# @return [String, nil]
|
12
12
|
attr_reader :value
|
13
|
+
# Value as String
|
14
|
+
# @return [String, nil]
|
15
|
+
attr_reader :raw_value
|
16
|
+
|
17
|
+
def initialize(prediction, page_id = nil, reconstructed: false)
|
18
|
+
super
|
19
|
+
@raw_value = prediction['raw_value']
|
20
|
+
end
|
13
21
|
end
|
14
22
|
end
|
15
23
|
end
|
@@ -60,6 +60,9 @@ module Mindee
|
|
60
60
|
# The net amount paid: does not include taxes, fees, and discounts.
|
61
61
|
# @return [Mindee::Parsing::Standard::AmountField]
|
62
62
|
attr_reader :total_net
|
63
|
+
# The total tax: includes all the taxes paid for this invoice.
|
64
|
+
# @return [Mindee::Parsing::Standard::AmountField]
|
65
|
+
attr_reader :total_tax
|
63
66
|
|
64
67
|
# @param prediction [Hash]
|
65
68
|
# @param page_id [Integer, nil]
|
@@ -97,6 +100,7 @@ module Mindee
|
|
97
100
|
@taxes = Taxes.new(prediction['taxes'], page_id)
|
98
101
|
@total_amount = AmountField.new(prediction['total_amount'], page_id)
|
99
102
|
@total_net = AmountField.new(prediction['total_net'], page_id)
|
103
|
+
@total_tax = AmountField.new(prediction['total_tax'], page_id)
|
100
104
|
end
|
101
105
|
|
102
106
|
# @return [String]
|
@@ -114,6 +118,7 @@ module Mindee
|
|
114
118
|
out_str << "\n:Due Date: #{@due_date}".rstrip
|
115
119
|
out_str << "\n:Total Net: #{@total_net}".rstrip
|
116
120
|
out_str << "\n:Total Amount: #{@total_amount}".rstrip
|
121
|
+
out_str << "\n:Total Tax: #{@total_tax}".rstrip
|
117
122
|
out_str << "\n:Taxes:#{@taxes}".rstrip
|
118
123
|
out_str << "\n:Supplier Payment Details: #{supplier_payment_details}".rstrip
|
119
124
|
out_str << "\n:Supplier Name: #{@supplier_name}".rstrip
|
data/lib/mindee/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mindee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindee, SA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: marcel
|