mindee 4.7.1 → 4.8.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.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +6 -6
  4. data/Rakefile +1 -0
  5. data/lib/mindee/errors/mindee_http_error_v2.rb +23 -4
  6. data/lib/mindee/errors/mindee_http_unknown_error_v2.rb +18 -0
  7. data/lib/mindee/http/endpoint.rb +1 -0
  8. data/lib/mindee/input/sources/local_input_source.rb +9 -1
  9. data/lib/mindee/parsing/v2/error_item.rb +21 -0
  10. data/lib/mindee/parsing/v2/error_response.rb +18 -3
  11. data/lib/mindee/parsing/v2/inference_result.rb +4 -0
  12. data/lib/mindee/parsing/v2/rag_metadata.rb +17 -0
  13. data/lib/mindee/product.rb +0 -1
  14. data/lib/mindee/version.rb +1 -1
  15. data/mindee.gemspec +1 -0
  16. data/sig/mindee/errors/mindee_http_error_v2.rbs +4 -1
  17. data/sig/mindee/errors/mindee_http_unknown_error_v2.rbs +9 -0
  18. data/sig/mindee/http/endpoint.rbs +1 -0
  19. data/sig/mindee/input/sources/local_input_source.rbs +1 -1
  20. data/sig/mindee/parsing/v2/error_item.rbs +13 -0
  21. data/sig/mindee/parsing/v2/error_response.rbs +3 -0
  22. data/sig/mindee/parsing/v2/inference_result.rbs +1 -0
  23. data/sig/mindee/parsing/v2/rag_metadata.rbs +13 -0
  24. metadata +22 -47
  25. data/docs/advanced_file_operations.md +0 -109
  26. data/docs/code_samples/us_mail_v2_async.txt +0 -24
  27. data/docs/getting_started.md +0 -257
  28. data/docs/global_products/barcode_reader_v1.md +0 -125
  29. data/docs/global_products/bill_of_lading_v1.md +0 -276
  30. data/docs/global_products/business_card_v1.md +0 -194
  31. data/docs/global_products/cropper_v1.md +0 -123
  32. data/docs/global_products/delivery_notes_v1.md +0 -168
  33. data/docs/global_products/driver_license_v1.md +0 -212
  34. data/docs/global_products/expense_receipts_v5.md +0 -415
  35. data/docs/global_products/financial_document_v1.md +0 -615
  36. data/docs/global_products/international_id_v2.md +0 -264
  37. data/docs/global_products/invoice_splitter_v1.md +0 -127
  38. data/docs/global_products/invoices_v4.md +0 -576
  39. data/docs/global_products/multi_receipts_detector_v1.md +0 -131
  40. data/docs/global_products/nutrition_facts_v1.md +0 -399
  41. data/docs/global_products/passport_v1.md +0 -207
  42. data/docs/global_products/resume_v1.md +0 -384
  43. data/docs/global_products/universal.md +0 -113
  44. data/docs/global_products.md +0 -6
  45. data/docs/loading_a_document.md +0 -330
  46. data/docs/localized_products/bank_account_details_v2.md +0 -158
  47. data/docs/localized_products/bank_check_v1.md +0 -205
  48. data/docs/localized_products/bank_statement_fr_v2.md +0 -269
  49. data/docs/localized_products/carte_grise_v1.md +0 -475
  50. data/docs/localized_products/energy_bill_fra_v1.md +0 -342
  51. data/docs/localized_products/french_healthcard_v1.md +0 -142
  52. data/docs/localized_products/idcard_fr_v2.md +0 -284
  53. data/docs/localized_products/ind_passport_v1.md +0 -307
  54. data/docs/localized_products/payslip_fra_v3.md +0 -344
  55. data/docs/localized_products/us_healthcare_cards_v1.md +0 -258
  56. data/docs/localized_products/us_mail_v3.md +0 -152
  57. data/docs/localized_products.md +0 -6
  58. data/lib/mindee/product/us/us_mail/us_mail_v2.rb +0 -47
  59. data/lib/mindee/product/us/us_mail/us_mail_v2_document.rb +0 -105
  60. data/lib/mindee/product/us/us_mail/us_mail_v2_page.rb +0 -38
  61. data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_address.rb +0 -105
  62. data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_addresses.rb +0 -63
  63. data/lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb +0 -66
  64. data/sig/mindee/product/us/us_mail/us_mail_v2.rbs +0 -13
  65. data/sig/mindee/product/us/us_mail/us_mail_v2_document.rbs +0 -20
  66. data/sig/mindee/product/us/us_mail/us_mail_v2_page.rbs +0 -17
  67. data/sig/mindee/product/us/us_mail/us_mail_v2_recipient_address.rbs +0 -22
  68. data/sig/mindee/product/us/us_mail/us_mail_v2_recipient_addresses.rbs +0 -15
  69. data/sig/mindee/product/us/us_mail/us_mail_v2_sender_address.rbs +0 -18
@@ -1,475 +0,0 @@
1
- ---
2
- title: FR Carte Grise
3
- category: 622b805aaec68102ea7fcbc2
4
- slug: ruby-fr-carte-grise-ocr
5
- parentDoc: 67b49e29a2cd6f08d69a40d8
6
- ---
7
- The Ruby Client Library supports the [Carte Grise API](https://platform.mindee.com/mindee/carte_grise).
8
-
9
-
10
- > 📝 Product Specs
11
- >
12
- > | Specification | Details |
13
- > | ------------------------------ | -------------------------------------------------- |
14
- > | Endpoint Name | `carte_grise` |
15
- > | Recommended Version | `v1.1` |
16
- > | Supports Polling/Webhooks | ❌ No |
17
- > | Support Synchronous HTTP Calls | ✔️ Yes |
18
- > | Geography | 🇫🇷 France |
19
-
20
-
21
- Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/carte_grise/default_sample.jpg),
22
- we are going to illustrate how to extract the data that we want using the Ruby Client Library.
23
- ![Carte Grise sample](https://github.com/mindee/client-lib-test-data/blob/main/products/carte_grise/default_sample.jpg?raw=true)
24
-
25
- # Quick-Start
26
- ```rb
27
- #
28
- # Install the Ruby client library by running:
29
- # gem install mindee
30
- #
31
-
32
- require 'mindee'
33
-
34
- # Init a new client
35
- mindee_client = Mindee::Client.new(api_key: 'my-api-key')
36
-
37
- # Load a file from disk
38
- input_source = mindee_client.source_from_path('/path/to/the/file.ext')
39
-
40
- # Parse the file
41
- result = mindee_client.parse(
42
- input_source,
43
- Mindee::Product::FR::CarteGrise::CarteGriseV1
44
- )
45
-
46
- # Print a full summary of the parsed data in RST format
47
- puts result.document
48
-
49
- # Print the document-level parsed data
50
- # puts result.document.inference.prediction
51
- ```
52
-
53
- **Output (RST):**
54
- ```rst
55
- ########
56
- Document
57
- ########
58
- :Mindee ID: 4443182b-57c1-4426-a288-01b94f226e84
59
- :Filename: default_sample.jpg
60
-
61
- Inference
62
- #########
63
- :Product: mindee/carte_grise v1.1
64
- :Rotation applied: Yes
65
-
66
- Prediction
67
- ==========
68
- :a: AB-123-CD
69
- :b: 1998-01-05
70
- :c1: DUPONT YVES
71
- :c3: 27 RUE DES ROITELETS 59169 FERIN LES BAINS FRANCE
72
- :c41: 2 DELAROCHE
73
- :c4a: EST LE PROPRIETAIRE DU VEHICULE
74
- :d1:
75
- :d3: MODELE
76
- :e: VFS1V2009AS1V2009
77
- :f1: 1915
78
- :f2: 1915
79
- :f3: 1915
80
- :g: 3030
81
- :g1: 1307
82
- :i: 2009-12-04
83
- :j: N1
84
- :j1: VP
85
- :j2: AA
86
- :j3: CI
87
- :p1: 1900
88
- :p2: 90
89
- :p3: GO
90
- :p6: 6
91
- :q: 006
92
- :s1: 5
93
- :s2:
94
- :u1: 77
95
- :u2: 3000
96
- :v7: 155
97
- :x1: 2011-07-06
98
- :y1: 17835
99
- :y2:
100
- :y3: 0
101
- :y4: 4
102
- :y5: 2.5
103
- :y6: 178.35
104
- :Formula Number: 2009AS05284
105
- :Owner's First Name: YVES
106
- :Owner's Surname: DUPONT
107
- :MRZ Line 1:
108
- :MRZ Line 2: CI<<MARQUES<<<<<<<MODELE<<<<<<<2009AS0528402
109
-
110
- Page Predictions
111
- ================
112
-
113
- Page 0
114
- ------
115
- :a: AB-123-CD
116
- :b: 1998-01-05
117
- :c1: DUPONT YVES
118
- :c3: 27 RUE DES ROITELETS 59169 FERIN LES BAINS FRANCE
119
- :c41: 2 DELAROCHE
120
- :c4a: EST LE PROPRIETAIRE DU VEHICULE
121
- :d1:
122
- :d3: MODELE
123
- :e: VFS1V2009AS1V2009
124
- :f1: 1915
125
- :f2: 1915
126
- :f3: 1915
127
- :g: 3030
128
- :g1: 1307
129
- :i: 2009-12-04
130
- :j: N1
131
- :j1: VP
132
- :j2: AA
133
- :j3: CI
134
- :p1: 1900
135
- :p2: 90
136
- :p3: GO
137
- :p6: 6
138
- :q: 006
139
- :s1: 5
140
- :s2:
141
- :u1: 77
142
- :u2: 3000
143
- :v7: 155
144
- :x1: 2011-07-06
145
- :y1: 17835
146
- :y2:
147
- :y3: 0
148
- :y4: 4
149
- :y5: 2.5
150
- :y6: 178.35
151
- :Formula Number: 2009AS05284
152
- :Owner's First Name: YVES
153
- :Owner's Surname: DUPONT
154
- :MRZ Line 1:
155
- :MRZ Line 2: CI<<MARQUES<<<<<<<MODELE<<<<<<<2009AS0528402
156
- ```
157
-
158
- # Field Types
159
- ## Standard Fields
160
- These fields are generic and used in several products.
161
-
162
- ### Basic Field
163
- Each prediction object contains a set of fields that inherit from the generic `Field` class.
164
- A typical `Field` object will have the following attributes:
165
-
166
- * **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted.
167
- * **confidence** (Float, nil): the confidence score of the field prediction.
168
- * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
169
- * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
170
- * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
171
- * **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it).
172
-
173
-
174
- 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.
175
-
176
- ### Date Field
177
- Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
178
-
179
- * **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
180
-
181
- ### String Field
182
- The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
183
-
184
- # Attributes
185
- The following fields are extracted for Carte Grise V1:
186
-
187
- ## a
188
- **a** ([StringField](#string-field)): The vehicle's license plate number.
189
-
190
- ```rb
191
- puts result.document.inference.prediction.a.value
192
- ```
193
-
194
- ## b
195
- **b** ([DateField](#date-field)): The vehicle's first release date.
196
-
197
- ```rb
198
- puts result.document.inference.prediction.b.value
199
- ```
200
-
201
- ## c1
202
- **c1** ([StringField](#string-field)): The vehicle owner's full name including maiden name.
203
-
204
- ```rb
205
- puts result.document.inference.prediction.c1.value
206
- ```
207
-
208
- ## c3
209
- **c3** ([StringField](#string-field)): The vehicle owner's address.
210
-
211
- ```rb
212
- puts result.document.inference.prediction.c3.value
213
- ```
214
-
215
- ## c41
216
- **c41** ([StringField](#string-field)): Number of owners of the license certificate.
217
-
218
- ```rb
219
- puts result.document.inference.prediction.c41.value
220
- ```
221
-
222
- ## c4a
223
- **c4a** ([StringField](#string-field)): Mentions about the ownership of the vehicle.
224
-
225
- ```rb
226
- puts result.document.inference.prediction.c4a.value
227
- ```
228
-
229
- ## d1
230
- **d1** ([StringField](#string-field)): The vehicle's brand.
231
-
232
- ```rb
233
- puts result.document.inference.prediction.d1.value
234
- ```
235
-
236
- ## d3
237
- **d3** ([StringField](#string-field)): The vehicle's commercial name.
238
-
239
- ```rb
240
- puts result.document.inference.prediction.d3.value
241
- ```
242
-
243
- ## e
244
- **e** ([StringField](#string-field)): The Vehicle Identification Number (VIN).
245
-
246
- ```rb
247
- puts result.document.inference.prediction.e.value
248
- ```
249
-
250
- ## f1
251
- **f1** ([StringField](#string-field)): The vehicle's maximum admissible weight.
252
-
253
- ```rb
254
- puts result.document.inference.prediction.f1.value
255
- ```
256
-
257
- ## f2
258
- **f2** ([StringField](#string-field)): The vehicle's maximum admissible weight within the license's state.
259
-
260
- ```rb
261
- puts result.document.inference.prediction.f2.value
262
- ```
263
-
264
- ## f3
265
- **f3** ([StringField](#string-field)): The vehicle's maximum authorized weight with coupling.
266
-
267
- ```rb
268
- puts result.document.inference.prediction.f3.value
269
- ```
270
-
271
- ## Formula Number
272
- **formula_number** ([StringField](#string-field)): The document's formula number.
273
-
274
- ```rb
275
- puts result.document.inference.prediction.formula_number.value
276
- ```
277
-
278
- ## g
279
- **g** ([StringField](#string-field)): The vehicle's weight with coupling if tractor different than category M1.
280
-
281
- ```rb
282
- puts result.document.inference.prediction.g.value
283
- ```
284
-
285
- ## g1
286
- **g1** ([StringField](#string-field)): The vehicle's national empty weight.
287
-
288
- ```rb
289
- puts result.document.inference.prediction.g1.value
290
- ```
291
-
292
- ## i
293
- **i** ([DateField](#date-field)): The car registration date of the given certificate.
294
-
295
- ```rb
296
- puts result.document.inference.prediction.i.value
297
- ```
298
-
299
- ## j
300
- **j** ([StringField](#string-field)): The vehicle's category.
301
-
302
- ```rb
303
- puts result.document.inference.prediction.j.value
304
- ```
305
-
306
- ## j1
307
- **j1** ([StringField](#string-field)): The vehicle's national type.
308
-
309
- ```rb
310
- puts result.document.inference.prediction.j1.value
311
- ```
312
-
313
- ## j2
314
- **j2** ([StringField](#string-field)): The vehicle's body type (CE).
315
-
316
- ```rb
317
- puts result.document.inference.prediction.j2.value
318
- ```
319
-
320
- ## j3
321
- **j3** ([StringField](#string-field)): The vehicle's body type (National designation).
322
-
323
- ```rb
324
- puts result.document.inference.prediction.j3.value
325
- ```
326
-
327
- ## MRZ Line 1
328
- **mrz1** ([StringField](#string-field)): Machine Readable Zone, first line.
329
-
330
- ```rb
331
- puts result.document.inference.prediction.mrz1.value
332
- ```
333
-
334
- ## MRZ Line 2
335
- **mrz2** ([StringField](#string-field)): Machine Readable Zone, second line.
336
-
337
- ```rb
338
- puts result.document.inference.prediction.mrz2.value
339
- ```
340
-
341
- ## Owner's First Name
342
- **owner_first_name** ([StringField](#string-field)): The vehicle's owner first name.
343
-
344
- ```rb
345
- puts result.document.inference.prediction.owner_first_name.value
346
- ```
347
-
348
- ## Owner's Surname
349
- **owner_surname** ([StringField](#string-field)): The vehicle's owner surname.
350
-
351
- ```rb
352
- puts result.document.inference.prediction.owner_surname.value
353
- ```
354
-
355
- ## p1
356
- **p1** ([StringField](#string-field)): The vehicle engine's displacement (cm3).
357
-
358
- ```rb
359
- puts result.document.inference.prediction.p1.value
360
- ```
361
-
362
- ## p2
363
- **p2** ([StringField](#string-field)): The vehicle's maximum net power (kW).
364
-
365
- ```rb
366
- puts result.document.inference.prediction.p2.value
367
- ```
368
-
369
- ## p3
370
- **p3** ([StringField](#string-field)): The vehicle's fuel type or energy source.
371
-
372
- ```rb
373
- puts result.document.inference.prediction.p3.value
374
- ```
375
-
376
- ## p6
377
- **p6** ([StringField](#string-field)): The vehicle's administrative power (fiscal horsepower).
378
-
379
- ```rb
380
- puts result.document.inference.prediction.p6.value
381
- ```
382
-
383
- ## q
384
- **q** ([StringField](#string-field)): The vehicle's power to weight ratio.
385
-
386
- ```rb
387
- puts result.document.inference.prediction.q.value
388
- ```
389
-
390
- ## s1
391
- **s1** ([StringField](#string-field)): The vehicle's number of seats.
392
-
393
- ```rb
394
- puts result.document.inference.prediction.s1.value
395
- ```
396
-
397
- ## s2
398
- **s2** ([StringField](#string-field)): The vehicle's number of standing rooms (person).
399
-
400
- ```rb
401
- puts result.document.inference.prediction.s2.value
402
- ```
403
-
404
- ## u1
405
- **u1** ([StringField](#string-field)): The vehicle's sound level (dB).
406
-
407
- ```rb
408
- puts result.document.inference.prediction.u1.value
409
- ```
410
-
411
- ## u2
412
- **u2** ([StringField](#string-field)): The vehicle engine's rotation speed (RPM).
413
-
414
- ```rb
415
- puts result.document.inference.prediction.u2.value
416
- ```
417
-
418
- ## v7
419
- **v7** ([StringField](#string-field)): The vehicle's CO2 emission (g/km).
420
-
421
- ```rb
422
- puts result.document.inference.prediction.v7.value
423
- ```
424
-
425
- ## x1
426
- **x1** ([StringField](#string-field)): Next technical control date.
427
-
428
- ```rb
429
- puts result.document.inference.prediction.x1.value
430
- ```
431
-
432
- ## y1
433
- **y1** ([StringField](#string-field)): Amount of the regional proportional tax of the registration (in euros).
434
-
435
- ```rb
436
- puts result.document.inference.prediction.y1.value
437
- ```
438
-
439
- ## y2
440
- **y2** ([StringField](#string-field)): Amount of the additional parafiscal tax of the registration (in euros).
441
-
442
- ```rb
443
- puts result.document.inference.prediction.y2.value
444
- ```
445
-
446
- ## y3
447
- **y3** ([StringField](#string-field)): Amount of the additional CO2 tax of the registration (in euros).
448
-
449
- ```rb
450
- puts result.document.inference.prediction.y3.value
451
- ```
452
-
453
- ## y4
454
- **y4** ([StringField](#string-field)): Amount of the fee for managing the registration (in euros).
455
-
456
- ```rb
457
- puts result.document.inference.prediction.y4.value
458
- ```
459
-
460
- ## y5
461
- **y5** ([StringField](#string-field)): Amount of the fee for delivery of the registration certificate in euros.
462
-
463
- ```rb
464
- puts result.document.inference.prediction.y5.value
465
- ```
466
-
467
- ## y6
468
- **y6** ([StringField](#string-field)): Total amount of registration fee to be paid in euros.
469
-
470
- ```rb
471
- puts result.document.inference.prediction.y6.value
472
- ```
473
-
474
- # Questions?
475
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)