mindee 3.20.0 → 4.0.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 (603) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -1
  3. data/CHANGELOG.md +23 -0
  4. data/README.md +25 -44
  5. data/Steepfile +31 -0
  6. data/bin/mindee.rb +30 -62
  7. data/docs/advanced_file_operations.md +111 -0
  8. data/docs/code_samples/bank_account_details_v1.txt +5 -0
  9. data/docs/code_samples/bank_account_details_v2.txt +5 -0
  10. data/docs/code_samples/bank_check_v1.txt +5 -0
  11. data/docs/code_samples/bank_statement_fr_v2_async.txt +6 -1
  12. data/docs/code_samples/barcode_reader_v1.txt +5 -0
  13. data/docs/code_samples/bill_of_lading_v1_async.txt +6 -1
  14. data/docs/code_samples/business_card_v1_async.txt +6 -1
  15. data/docs/code_samples/carte_grise_v1.txt +5 -0
  16. data/docs/code_samples/cropper_v1.txt +5 -0
  17. data/docs/code_samples/default.txt +8 -2
  18. data/docs/code_samples/default_async.txt +7 -2
  19. data/docs/code_samples/delivery_notes_v1_async.txt +6 -1
  20. data/docs/code_samples/driver_license_v1_async.txt +6 -1
  21. data/docs/code_samples/energy_bill_fra_v1_async.txt +6 -1
  22. data/docs/code_samples/expense_receipts_v5.txt +7 -1
  23. data/docs/code_samples/expense_receipts_v5_async.txt +6 -1
  24. data/docs/code_samples/financial_document_v1.txt +7 -1
  25. data/docs/code_samples/financial_document_v1_async.txt +6 -1
  26. data/docs/code_samples/french_healthcard_v1_async.txt +6 -1
  27. data/docs/code_samples/idcard_fr_v1.txt +5 -0
  28. data/docs/code_samples/idcard_fr_v2.txt +5 -0
  29. data/docs/code_samples/ind_passport_v1_async.txt +6 -1
  30. data/docs/code_samples/international_id_v2_async.txt +6 -1
  31. data/docs/code_samples/invoice_splitter_v1_async.txt +6 -1
  32. data/docs/code_samples/invoices_v4.txt +7 -1
  33. data/docs/code_samples/invoices_v4_async.txt +6 -1
  34. data/docs/code_samples/license_plates_v1.txt +5 -0
  35. data/docs/code_samples/multi_receipts_detector_v1.txt +5 -0
  36. data/docs/code_samples/nutrition_facts_v1_async.txt +6 -1
  37. data/docs/code_samples/passport_v1.txt +5 -0
  38. data/docs/code_samples/payslip_fra_v2_async.txt +6 -1
  39. data/docs/code_samples/payslip_fra_v3_async.txt +6 -1
  40. data/docs/code_samples/resume_v1_async.txt +6 -1
  41. data/docs/code_samples/us_healthcare_cards_v1_async.txt +6 -1
  42. data/docs/code_samples/us_mail_v3_async.txt +6 -1
  43. data/docs/code_samples/us_w9_v1.txt +5 -0
  44. data/docs/getting_started.md +50 -118
  45. data/docs/{barcode_reader_v1.md → global_products/barcode_reader_v1.md} +26 -9
  46. data/docs/{bill_of_lading_v1.md → global_products/bill_of_lading_v1.md} +62 -37
  47. data/docs/{business_card_v1.md → global_products/business_card_v1.md} +35 -10
  48. data/docs/{cropper_v1.md → global_products/cropper_v1.md} +32 -13
  49. data/docs/{delivery_notes_v1.md → global_products/delivery_notes_v1.md} +35 -10
  50. data/docs/{driver_license_v1.md → global_products/driver_license_v1.md} +35 -10
  51. data/docs/{expense_receipts_v5.md → global_products/expense_receipts_v5.md} +57 -21
  52. data/docs/{financial_document_v1.md → global_products/financial_document_v1.md} +65 -28
  53. data/docs/{international_id_v2.md → global_products/international_id_v2.md} +39 -13
  54. data/docs/{invoice_splitter_v1.md → global_products/invoice_splitter_v1.md} +25 -6
  55. data/docs/{invoices_v4.md → global_products/invoices_v4.md} +65 -28
  56. data/docs/{multi_receipts_detector_v1.md → global_products/multi_receipts_detector_v1.md} +32 -13
  57. data/docs/{nutrition_facts_v1.md → global_products/nutrition_facts_v1.md} +103 -78
  58. data/docs/{passport_v1.md → global_products/passport_v1.md} +26 -9
  59. data/docs/{resume_v1.md → global_products/resume_v1.md} +72 -46
  60. data/docs/{generated_v1.md → global_products/universal.md} +39 -19
  61. data/docs/global_products.md +6 -0
  62. data/docs/loading_a_document.md +316 -0
  63. data/docs/{bank_account_details_v2.md → localized_products/bank_account_details_v2.md} +24 -7
  64. data/docs/{bank_check_v1.md → localized_products/bank_check_v1.md} +37 -18
  65. data/docs/{bank_statement_fr_v2.md → localized_products/bank_statement_fr_v2.md} +37 -12
  66. data/docs/{carte_grise_v1.md → localized_products/carte_grise_v1.md} +25 -8
  67. data/docs/{energy_bill_fra_v1.md → localized_products/energy_bill_fra_v1.md} +70 -45
  68. data/docs/{french_healthcard_v1.md → localized_products/french_healthcard_v1.md} +36 -11
  69. data/docs/{idcard_fr_v2.md → localized_products/idcard_fr_v2.md} +34 -16
  70. data/docs/{ind_passport_v1.md → localized_products/ind_passport_v1.md} +37 -11
  71. data/docs/{license_plates_v1.md → localized_products/license_plates_v1.md} +25 -8
  72. data/docs/{payslip_fra_v3.md → localized_products/payslip_fra_v3.md} +80 -55
  73. data/docs/{us_healthcare_cards_v1.md → localized_products/us_healthcare_cards_v1.md} +37 -12
  74. data/docs/{us_mail_v3.md → localized_products/us_mail_v3.md} +49 -24
  75. data/docs/{us_w9_v1.md → localized_products/us_w9_v1.md} +64 -45
  76. data/docs/localized_products.md +6 -0
  77. data/examples/auto_invoice_splitter_extraction.rb +5 -5
  78. data/examples/auto_multi_receipts_detector_extraction.rb +4 -5
  79. data/lib/mindee/client.rb +354 -209
  80. data/lib/mindee/errors/mindee_error.rb +17 -0
  81. data/lib/mindee/errors/mindee_http_error.rb +36 -0
  82. data/lib/mindee/errors/mindee_input_error.rb +30 -0
  83. data/lib/mindee/errors.rb +5 -0
  84. data/lib/mindee/extraction/multi_receipts_extractor.rb +28 -1
  85. data/lib/mindee/extraction.rb +0 -3
  86. data/lib/mindee/geometry/polygon.rb +1 -1
  87. data/lib/mindee/geometry/utils.rb +1 -1
  88. data/lib/mindee/http/endpoint.rb +48 -40
  89. data/lib/mindee/http/{error.rb → http_error_handler.rb} +5 -35
  90. data/lib/mindee/http/response_validation.rb +2 -2
  91. data/lib/mindee/http/workflow_endpoint.rb +12 -12
  92. data/lib/mindee/http.rb +1 -1
  93. data/lib/mindee/{extraction/common → image}/extracted_image.rb +22 -18
  94. data/lib/mindee/{extraction/common → image}/image_extractor.rb +20 -78
  95. data/lib/mindee/image/image_utils.rb +68 -7
  96. data/lib/mindee/image.rb +2 -0
  97. data/lib/mindee/input/local_response.rb +8 -8
  98. data/lib/mindee/input/sources/base64_input_source.rb +6 -6
  99. data/lib/mindee/input/sources/bytes_input_source.rb +3 -3
  100. data/lib/mindee/input/sources/file_input_source.rb +3 -3
  101. data/lib/mindee/input/sources/local_input_source.rb +43 -41
  102. data/lib/mindee/input/sources/path_input_source.rb +3 -3
  103. data/lib/mindee/input/sources/url_input_source.rb +11 -8
  104. data/lib/mindee/logging/logger.rb +16 -0
  105. data/lib/mindee/logging.rb +3 -0
  106. data/lib/mindee/parsing/common/api_request.rb +36 -0
  107. data/lib/mindee/parsing/common/api_response.rb +6 -96
  108. data/lib/mindee/parsing/common/document.rb +12 -8
  109. data/lib/mindee/parsing/common/execution.rb +4 -2
  110. data/lib/mindee/parsing/common/execution_priority.rb +6 -0
  111. data/lib/mindee/parsing/common/extras/cropper_extra.rb +2 -1
  112. data/lib/mindee/parsing/common/extras/extras.rb +9 -4
  113. data/lib/mindee/parsing/common/extras/full_text_ocr_extra.rb +1 -0
  114. data/lib/mindee/parsing/common/inference.rb +23 -4
  115. data/lib/mindee/parsing/common/job.rb +46 -0
  116. data/lib/mindee/parsing/common/ocr/mvision_v1.rb +6 -6
  117. data/lib/mindee/parsing/common/ocr/ocr.rb +29 -29
  118. data/lib/mindee/parsing/common/page.rb +5 -3
  119. data/lib/mindee/parsing/common/prediction.rb +2 -0
  120. data/lib/mindee/parsing/common/workflow_response.rb +28 -0
  121. data/lib/mindee/parsing/common.rb +3 -0
  122. data/lib/mindee/parsing/standard/abstract_field.rb +72 -0
  123. data/lib/mindee/parsing/standard/amount_field.rb +2 -2
  124. data/lib/mindee/parsing/standard/base_field.rb +5 -84
  125. data/lib/mindee/parsing/standard/boolean_field.rb +4 -3
  126. data/lib/mindee/parsing/standard/classification_field.rb +1 -1
  127. data/lib/mindee/parsing/standard/company_registration_field.rb +7 -2
  128. data/lib/mindee/parsing/standard/date_field.rb +2 -2
  129. data/lib/mindee/parsing/standard/feature_field.rb +24 -0
  130. data/lib/mindee/parsing/standard/payment_details_field.rb +2 -2
  131. data/lib/mindee/parsing/standard/position_field.rb +3 -1
  132. data/lib/mindee/parsing/standard/string_field.rb +1 -1
  133. data/lib/mindee/parsing/standard/tax_field.rb +1 -1
  134. data/lib/mindee/parsing/standard.rb +1 -0
  135. data/lib/mindee/parsing/{generated/generated_list_field.rb → universal/universal_list_field.rb} +12 -12
  136. data/lib/mindee/parsing/{generated/generated_object_field.rb → universal/universal_object_field.rb} +23 -14
  137. data/lib/mindee/parsing/universal.rb +4 -0
  138. data/lib/mindee/parsing.rb +1 -2
  139. data/lib/mindee/{extraction/pdf_extractor → pdf}/extracted_pdf.rb +15 -12
  140. data/lib/mindee/pdf/pdf_compressor.rb +12 -10
  141. data/lib/mindee/{extraction/pdf_extractor → pdf}/pdf_extractor.rb +20 -17
  142. data/lib/mindee/pdf/pdf_processor.rb +12 -22
  143. data/lib/mindee/pdf/pdf_tools.rb +52 -6
  144. data/lib/mindee/pdf.rb +2 -0
  145. data/lib/mindee/product/.rubocop.yml +3 -0
  146. data/lib/mindee/product/barcode_reader/barcode_reader_v1.rb +9 -3
  147. data/lib/mindee/product/barcode_reader/barcode_reader_v1_document.rb +5 -5
  148. data/lib/mindee/product/barcode_reader/barcode_reader_v1_page.rb +9 -5
  149. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1.rb +9 -3
  150. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb +1 -1
  151. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_item.rb +13 -7
  152. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rb +62 -0
  153. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb +1 -1
  154. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_document.rb +44 -17
  155. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_notify_party.rb +1 -1
  156. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_page.rb +9 -5
  157. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_shipper.rb +1 -1
  158. data/lib/mindee/product/business_card/business_card_v1.rb +9 -3
  159. data/lib/mindee/product/business_card/business_card_v1_document.rb +40 -13
  160. data/lib/mindee/product/business_card/business_card_v1_page.rb +9 -5
  161. data/lib/mindee/product/cropper/cropper_v1.rb +10 -4
  162. data/lib/mindee/product/cropper/cropper_v1_page.rb +11 -7
  163. data/lib/mindee/product/delivery_note/delivery_note_v1.rb +9 -3
  164. data/lib/mindee/product/delivery_note/delivery_note_v1_document.rb +29 -8
  165. data/lib/mindee/product/delivery_note/delivery_note_v1_page.rb +9 -5
  166. data/lib/mindee/product/driver_license/driver_license_v1.rb +9 -3
  167. data/lib/mindee/product/driver_license/driver_license_v1_document.rb +44 -14
  168. data/lib/mindee/product/driver_license/driver_license_v1_page.rb +9 -5
  169. data/lib/mindee/product/eu/license_plate/license_plate_v1.rb +9 -3
  170. data/lib/mindee/product/eu/license_plate/license_plate_v1_document.rb +3 -3
  171. data/lib/mindee/product/eu/license_plate/license_plate_v1_page.rb +9 -5
  172. data/lib/mindee/product/financial_document/financial_document_v1.rb +9 -3
  173. data/lib/mindee/product/financial_document/financial_document_v1_document.rb +110 -42
  174. data/lib/mindee/product/financial_document/financial_document_v1_line_item.rb +21 -11
  175. data/lib/mindee/product/financial_document/financial_document_v1_line_items.rb +62 -0
  176. data/lib/mindee/product/financial_document/financial_document_v1_page.rb +9 -5
  177. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1.rb +9 -3
  178. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1_document.rb +7 -4
  179. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1_page.rb +9 -5
  180. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2.rb +9 -3
  181. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_bban.rb +1 -1
  182. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rb +11 -5
  183. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_page.rb +9 -5
  184. data/lib/mindee/product/fr/bank_statement/bank_statement_v2.rb +9 -3
  185. data/lib/mindee/product/fr/bank_statement/bank_statement_v2_document.rb +52 -20
  186. data/lib/mindee/product/fr/bank_statement/bank_statement_v2_page.rb +9 -5
  187. data/lib/mindee/product/fr/bank_statement/bank_statement_v2_transaction.rb +5 -3
  188. data/lib/mindee/product/fr/bank_statement/bank_statement_v2_transactions.rb +54 -0
  189. data/lib/mindee/product/fr/carte_grise/carte_grise_v1.rb +9 -3
  190. data/lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb +51 -42
  191. data/lib/mindee/product/fr/carte_grise/carte_grise_v1_page.rb +9 -5
  192. data/lib/mindee/product/fr/energy_bill/energy_bill_v1.rb +9 -3
  193. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_document.rb +56 -30
  194. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb +1 -1
  195. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.rb +1 -1
  196. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rb +13 -7
  197. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rb +65 -0
  198. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb +1 -1
  199. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_page.rb +9 -5
  200. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_subscription.rb +13 -7
  201. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_subscriptions.rb +65 -0
  202. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rb +13 -7
  203. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rb +65 -0
  204. data/lib/mindee/product/fr/health_card/health_card_v1.rb +9 -3
  205. data/lib/mindee/product/fr/health_card/health_card_v1_document.rb +15 -6
  206. data/lib/mindee/product/fr/health_card/health_card_v1_page.rb +9 -5
  207. data/lib/mindee/product/fr/id_card/id_card_v1.rb +9 -3
  208. data/lib/mindee/product/fr/id_card/id_card_v1_document.rb +33 -12
  209. data/lib/mindee/product/fr/id_card/id_card_v1_page.rb +14 -7
  210. data/lib/mindee/product/fr/id_card/id_card_v2.rb +9 -3
  211. data/lib/mindee/product/fr/id_card/id_card_v2_document.rb +50 -17
  212. data/lib/mindee/product/fr/id_card/id_card_v2_page.rb +18 -8
  213. data/lib/mindee/product/fr/payslip/payslip_v2.rb +9 -3
  214. data/lib/mindee/product/fr/payslip/payslip_v2_bank_account_detail.rb +1 -1
  215. data/lib/mindee/product/fr/payslip/payslip_v2_document.rb +29 -14
  216. data/lib/mindee/product/fr/payslip/payslip_v2_employee.rb +1 -1
  217. data/lib/mindee/product/fr/payslip/payslip_v2_employer.rb +1 -1
  218. data/lib/mindee/product/fr/payslip/payslip_v2_employment.rb +3 -2
  219. data/lib/mindee/product/fr/payslip/payslip_v2_page.rb +9 -5
  220. data/lib/mindee/product/fr/payslip/payslip_v2_pay_detail.rb +33 -11
  221. data/lib/mindee/product/fr/payslip/payslip_v2_pay_period.rb +1 -1
  222. data/lib/mindee/product/fr/payslip/payslip_v2_pto.rb +13 -4
  223. data/lib/mindee/product/fr/payslip/payslip_v2_salary_detail.rb +13 -7
  224. data/lib/mindee/product/fr/payslip/payslip_v2_salary_details.rb +63 -0
  225. data/lib/mindee/product/fr/payslip/payslip_v3.rb +9 -3
  226. data/lib/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rb +1 -1
  227. data/lib/mindee/product/fr/payslip/payslip_v3_document.rb +31 -19
  228. data/lib/mindee/product/fr/payslip/payslip_v3_employee.rb +1 -1
  229. data/lib/mindee/product/fr/payslip/payslip_v3_employer.rb +1 -1
  230. data/lib/mindee/product/fr/payslip/payslip_v3_employment.rb +1 -1
  231. data/lib/mindee/product/fr/payslip/payslip_v3_page.rb +9 -5
  232. data/lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb +13 -7
  233. data/lib/mindee/product/fr/payslip/payslip_v3_paid_time_offs.rb +65 -0
  234. data/lib/mindee/product/fr/payslip/payslip_v3_pay_detail.rb +33 -11
  235. data/lib/mindee/product/fr/payslip/payslip_v3_pay_period.rb +1 -1
  236. data/lib/mindee/product/fr/payslip/payslip_v3_salary_detail.rb +17 -9
  237. data/lib/mindee/product/fr/payslip/payslip_v3_salary_details.rb +65 -0
  238. data/lib/mindee/product/ind/indian_passport/indian_passport_v1.rb +9 -3
  239. data/lib/mindee/product/ind/indian_passport/indian_passport_v1_document.rb +87 -24
  240. data/lib/mindee/product/ind/indian_passport/indian_passport_v1_page.rb +9 -5
  241. data/lib/mindee/product/international_id/international_id_v2.rb +9 -3
  242. data/lib/mindee/product/international_id/international_id_v2_document.rb +62 -20
  243. data/lib/mindee/product/international_id/international_id_v2_page.rb +9 -5
  244. data/lib/mindee/product/invoice/invoice_v4.rb +9 -3
  245. data/lib/mindee/product/invoice/invoice_v4_document.rb +90 -36
  246. data/lib/mindee/product/invoice/invoice_v4_line_item.rb +21 -11
  247. data/lib/mindee/product/invoice/invoice_v4_line_items.rb +62 -0
  248. data/lib/mindee/product/invoice/invoice_v4_page.rb +9 -5
  249. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1.rb +8 -0
  250. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb +2 -2
  251. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_page.rb +1 -1
  252. data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.rb +9 -3
  253. data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_document.rb +3 -3
  254. data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_page.rb +9 -5
  255. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1.rb +9 -3
  256. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rb +7 -4
  257. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rb +7 -4
  258. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rb +7 -4
  259. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rb +7 -4
  260. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_document.rb +58 -20
  261. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rb +13 -7
  262. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rb +68 -0
  263. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_page.rb +9 -5
  264. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rb +7 -4
  265. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rb +7 -4
  266. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rb +3 -2
  267. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rb +7 -4
  268. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rb +7 -4
  269. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rb +7 -4
  270. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rb +7 -4
  271. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rb +7 -4
  272. data/lib/mindee/product/passport/passport_v1.rb +9 -3
  273. data/lib/mindee/product/passport/passport_v1_document.rb +37 -13
  274. data/lib/mindee/product/passport/passport_v1_page.rb +9 -5
  275. data/lib/mindee/product/receipt/receipt_v5.rb +9 -3
  276. data/lib/mindee/product/receipt/receipt_v5_document.rb +54 -24
  277. data/lib/mindee/product/receipt/receipt_v5_line_item.rb +13 -7
  278. data/lib/mindee/product/receipt/receipt_v5_line_items.rb +54 -0
  279. data/lib/mindee/product/receipt/receipt_v5_page.rb +9 -5
  280. data/lib/mindee/product/resume/resume_v1.rb +9 -3
  281. data/lib/mindee/product/resume/resume_v1_certificate.rb +1 -1
  282. data/lib/mindee/product/resume/resume_v1_certificates.rb +58 -0
  283. data/lib/mindee/product/resume/resume_v1_document.rb +60 -47
  284. data/lib/mindee/product/resume/resume_v1_education.rb +1 -1
  285. data/lib/mindee/product/resume/resume_v1_educations.rb +64 -0
  286. data/lib/mindee/product/resume/resume_v1_language.rb +1 -1
  287. data/lib/mindee/product/resume/resume_v1_languages.rb +54 -0
  288. data/lib/mindee/product/resume/resume_v1_page.rb +9 -5
  289. data/lib/mindee/product/resume/resume_v1_professional_experience.rb +1 -1
  290. data/lib/mindee/product/resume/resume_v1_professional_experiences.rb +68 -0
  291. data/lib/mindee/product/resume/resume_v1_social_networks_url.rb +1 -1
  292. data/lib/mindee/product/resume/resume_v1_social_networks_urls.rb +54 -0
  293. data/lib/mindee/product/universal/universal.rb +46 -0
  294. data/lib/mindee/product/universal/universal_document.rb +32 -0
  295. data/lib/mindee/product/{generated/generated_v1_page.rb → universal/universal_page.rb} +14 -14
  296. data/lib/mindee/product/{generated/generated_v1_prediction.rb → universal/universal_prediction.rb} +32 -24
  297. data/lib/mindee/product/us/bank_check/bank_check_v1.rb +9 -3
  298. data/lib/mindee/product/us/bank_check/bank_check_v1_document.rb +20 -8
  299. data/lib/mindee/product/us/bank_check/bank_check_v1_page.rb +15 -8
  300. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1.rb +9 -3
  301. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb +5 -3
  302. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb +52 -0
  303. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb +46 -19
  304. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb +9 -5
  305. data/lib/mindee/product/us/us_mail/us_mail_v3.rb +9 -3
  306. data/lib/mindee/product/us/us_mail/us_mail_v3_document.rb +20 -12
  307. data/lib/mindee/product/us/us_mail/us_mail_v3_page.rb +9 -5
  308. data/lib/mindee/product/us/us_mail/us_mail_v3_recipient_address.rb +2 -2
  309. data/lib/mindee/product/us/us_mail/us_mail_v3_recipient_addresses.rb +65 -0
  310. data/lib/mindee/product/us/us_mail/us_mail_v3_sender_address.rb +1 -1
  311. data/lib/mindee/product/us/w9/w9_v1.rb +10 -4
  312. data/lib/mindee/product/us/w9/w9_v1_page.rb +49 -18
  313. data/lib/mindee/product.rb +1 -8
  314. data/lib/mindee/version.rb +2 -2
  315. data/lib/mindee.rb +22 -9
  316. data/mindee.gemspec +19 -17
  317. data/sig/custom/marcel.rbs +3 -0
  318. data/sig/custom/mini_magick.rbs +24 -0
  319. data/sig/custom/net_http.rbs +34 -0
  320. data/sig/custom/origami.rbs +54 -0
  321. data/sig/mindee/client.rbs +63 -0
  322. data/sig/mindee/errors/mindee_error.rbs +13 -0
  323. data/sig/mindee/errors/mindee_http_error.rbs +16 -0
  324. data/sig/mindee/errors/mindee_input_error.rbs +17 -0
  325. data/sig/mindee/extraction/multi_receipts_extractor.rbs +6 -0
  326. data/sig/mindee/geometry/min_max.rbs +10 -0
  327. data/sig/mindee/geometry/point.rbs +13 -0
  328. data/sig/mindee/geometry/polygon.rbs +9 -0
  329. data/sig/mindee/geometry/quadrilateral.rbs +18 -0
  330. data/sig/mindee/geometry/utils.rbs +13 -0
  331. data/sig/mindee/http/endpoint.rbs +26 -0
  332. data/sig/mindee/http/http_error_handler.rbs +10 -0
  333. data/sig/mindee/http/response_validation.rbs +10 -0
  334. data/sig/mindee/http/workflow_endpoint.rbs +14 -0
  335. data/sig/mindee/image/extracted_image.rbs +15 -0
  336. data/sig/mindee/image/image_compressor.rbs +8 -0
  337. data/sig/mindee/image/image_extractor.rbs +13 -0
  338. data/sig/mindee/image/image_utils.rbs +19 -0
  339. data/sig/mindee/input/local_response.rbs +13 -0
  340. data/sig/mindee/input/sources/base64_input_source.rbs +11 -0
  341. data/sig/mindee/input/sources/bytes_input_source.rbs +10 -0
  342. data/sig/mindee/input/sources/file_input_source.rbs +10 -0
  343. data/sig/mindee/input/sources/local_input_source.rbs +24 -0
  344. data/sig/mindee/input/sources/path_input_source.rbs +10 -0
  345. data/sig/mindee/input/sources/url_input_source.rbs +20 -0
  346. data/sig/mindee/logging/logger.rbs +9 -0
  347. data/sig/mindee/parsing/common/api_request.rbs +15 -0
  348. data/sig/mindee/parsing/common/api_response.rbs +27 -0
  349. data/sig/mindee/parsing/common/document.rbs +20 -0
  350. data/sig/mindee/parsing/common/execution.rbs +23 -0
  351. data/sig/mindee/parsing/common/execution_file.rbs +12 -0
  352. data/sig/mindee/parsing/common/execution_priority.rbs +13 -0
  353. data/sig/mindee/parsing/common/extras/cropper_extra.rbs +14 -0
  354. data/sig/mindee/parsing/common/extras/extras.rbs +18 -0
  355. data/sig/mindee/parsing/common/extras/full_text_ocr_extra.rbs +15 -0
  356. data/sig/mindee/parsing/common/inference.rbs +19 -0
  357. data/sig/mindee/parsing/common/job.rbs +16 -0
  358. data/sig/mindee/parsing/common/ocr/mvision_v1.rbs +15 -0
  359. data/sig/mindee/parsing/common/ocr/ocr.rbs +39 -0
  360. data/sig/mindee/parsing/common/orientation.rbs +12 -0
  361. data/sig/mindee/parsing/common/page.rbs +15 -0
  362. data/sig/mindee/parsing/common/prediction.rbs +11 -0
  363. data/sig/mindee/parsing/common/product.rbs +13 -0
  364. data/sig/mindee/parsing/common/workflow_response.rbs +13 -0
  365. data/sig/mindee/parsing/standard/abstract_field.rbs +19 -0
  366. data/sig/mindee/parsing/standard/amount_field.rbs +12 -0
  367. data/sig/mindee/parsing/standard/base_field.rbs +12 -0
  368. data/sig/mindee/parsing/standard/boolean_field.rbs +12 -0
  369. data/sig/mindee/parsing/standard/classification_field.rbs +10 -0
  370. data/sig/mindee/parsing/standard/company_registration_field.rbs +14 -0
  371. data/sig/mindee/parsing/standard/date_field.rbs +14 -0
  372. data/sig/mindee/parsing/standard/feature_field.rbs +10 -0
  373. data/sig/mindee/parsing/standard/locale_field.rbs +16 -0
  374. data/sig/mindee/parsing/standard/payment_details_field.rbs +15 -0
  375. data/sig/mindee/parsing/standard/position_field.rbs +17 -0
  376. data/sig/mindee/parsing/standard/string_field.rbs +12 -0
  377. data/sig/mindee/parsing/standard/tax_field.rbs +23 -0
  378. data/sig/mindee/parsing/universal/universal_list_field.rbs +17 -0
  379. data/sig/mindee/parsing/universal/universal_object_field.rbs +23 -0
  380. data/sig/mindee/pdf/extracted_pdf.rbs +15 -0
  381. data/sig/mindee/pdf/pdf_compressor.rbs +15 -0
  382. data/sig/mindee/pdf/pdf_extractor.rbs +16 -0
  383. data/sig/mindee/pdf/pdf_processor.rbs +12 -0
  384. data/sig/mindee/pdf/pdf_tools.rbs +23 -0
  385. data/sig/mindee/product/barcode_reader/barcode_reader_v1.rbs +11 -0
  386. data/sig/mindee/product/barcode_reader/barcode_reader_v1_document.rbs +14 -0
  387. data/sig/mindee/product/barcode_reader/barcode_reader_v1_page.rbs +15 -0
  388. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1.rbs +11 -0
  389. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rbs +14 -0
  390. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_item.rbs +19 -0
  391. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rbs +13 -0
  392. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rbs +15 -0
  393. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_document.rbs +25 -0
  394. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_notify_party.rbs +15 -0
  395. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_page.rbs +15 -0
  396. data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_shipper.rbs +15 -0
  397. data/sig/mindee/product/business_card/business_card_v1.rbs +11 -0
  398. data/sig/mindee/product/business_card/business_card_v1_document.rbs +23 -0
  399. data/sig/mindee/product/business_card/business_card_v1_page.rbs +15 -0
  400. data/sig/mindee/product/cropper/cropper_v1.rbs +11 -0
  401. data/sig/mindee/product/cropper/cropper_v1_document.rbs +12 -0
  402. data/sig/mindee/product/cropper/cropper_v1_page.rbs +16 -0
  403. data/sig/mindee/product/delivery_note/delivery_note_v1.rbs +11 -0
  404. data/sig/mindee/product/delivery_note/delivery_note_v1_document.rbs +19 -0
  405. data/sig/mindee/product/delivery_note/delivery_note_v1_page.rbs +15 -0
  406. data/sig/mindee/product/driver_license/driver_license_v1.rbs +11 -0
  407. data/sig/mindee/product/driver_license/driver_license_v1_document.rbs +25 -0
  408. data/sig/mindee/product/driver_license/driver_license_v1_page.rbs +15 -0
  409. data/sig/mindee/product/eu/license_plate/license_plate_v1.rbs +13 -0
  410. data/sig/mindee/product/eu/license_plate/license_plate_v1_document.rbs +15 -0
  411. data/sig/mindee/product/eu/license_plate/license_plate_v1_page.rbs +17 -0
  412. data/sig/mindee/product/financial_document/financial_document_v1.rbs +11 -0
  413. data/sig/mindee/product/financial_document/financial_document_v1_document.rbs +46 -0
  414. data/sig/mindee/product/financial_document/financial_document_v1_line_item.rbs +21 -0
  415. data/sig/mindee/product/financial_document/financial_document_v1_line_items.rbs +13 -0
  416. data/sig/mindee/product/financial_document/financial_document_v1_page.rbs +15 -0
  417. data/sig/mindee/product/fr/bank_account_details/bank_account_details_v1.rbs +13 -0
  418. data/sig/mindee/product/fr/bank_account_details/bank_account_details_v1_document.rbs +17 -0
  419. data/sig/mindee/product/fr/bank_account_details/bank_account_details_v1_page.rbs +17 -0
  420. data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2.rbs +13 -0
  421. data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2_bban.rbs +17 -0
  422. data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rbs +18 -0
  423. data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2_page.rbs +17 -0
  424. data/sig/mindee/product/fr/bank_statement/bank_statement_v2.rbs +13 -0
  425. data/sig/mindee/product/fr/bank_statement/bank_statement_v2_document.rbs +29 -0
  426. data/sig/mindee/product/fr/bank_statement/bank_statement_v2_page.rbs +17 -0
  427. data/sig/mindee/product/fr/bank_statement/bank_statement_v2_transaction.rbs +18 -0
  428. data/sig/mindee/product/fr/bank_statement/bank_statement_v2_transactions.rbs +15 -0
  429. data/sig/mindee/product/fr/carte_grise/carte_grise_v1.rbs +13 -0
  430. data/sig/mindee/product/fr/carte_grise/carte_grise_v1_document.rbs +55 -0
  431. data/sig/mindee/product/fr/carte_grise/carte_grise_v1_page.rbs +17 -0
  432. data/sig/mindee/product/fr/energy_bill/energy_bill_v1.rbs +13 -0
  433. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_document.rbs +34 -0
  434. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rbs +15 -0
  435. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.rbs +15 -0
  436. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rbs +21 -0
  437. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rbs +15 -0
  438. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rbs +16 -0
  439. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_page.rbs +17 -0
  440. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_subscription.rbs +21 -0
  441. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_subscriptions.rbs +15 -0
  442. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rbs +21 -0
  443. data/sig/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rbs +15 -0
  444. data/sig/mindee/product/fr/health_card/health_card_v1.rbs +13 -0
  445. data/sig/mindee/product/fr/health_card/health_card_v1_document.rbs +18 -0
  446. data/sig/mindee/product/fr/health_card/health_card_v1_page.rbs +17 -0
  447. data/sig/mindee/product/fr/id_card/id_card_v1.rbs +13 -0
  448. data/sig/mindee/product/fr/id_card/id_card_v1_document.rbs +24 -0
  449. data/sig/mindee/product/fr/id_card/id_card_v1_page.rbs +18 -0
  450. data/sig/mindee/product/fr/id_card/id_card_v2.rbs +13 -0
  451. data/sig/mindee/product/fr/id_card/id_card_v2_document.rbs +29 -0
  452. data/sig/mindee/product/fr/id_card/id_card_v2_page.rbs +19 -0
  453. data/sig/mindee/product/fr/payslip/payslip_v2.rbs +13 -0
  454. data/sig/mindee/product/fr/payslip/payslip_v2_bank_account_detail.rbs +16 -0
  455. data/sig/mindee/product/fr/payslip/payslip_v2_document.rbs +24 -0
  456. data/sig/mindee/product/fr/payslip/payslip_v2_employee.rbs +20 -0
  457. data/sig/mindee/product/fr/payslip/payslip_v2_employer.rbs +20 -0
  458. data/sig/mindee/product/fr/payslip/payslip_v2_employment.rbs +19 -0
  459. data/sig/mindee/product/fr/payslip/payslip_v2_page.rbs +17 -0
  460. data/sig/mindee/product/fr/payslip/payslip_v2_pay_detail.rbs +23 -0
  461. data/sig/mindee/product/fr/payslip/payslip_v2_pay_period.rbs +18 -0
  462. data/sig/mindee/product/fr/payslip/payslip_v2_pto.rbs +16 -0
  463. data/sig/mindee/product/fr/payslip/payslip_v2_salary_detail.rbs +19 -0
  464. data/sig/mindee/product/fr/payslip/payslip_v2_salary_details.rbs +15 -0
  465. data/sig/mindee/product/fr/payslip/payslip_v3.rbs +13 -0
  466. data/sig/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rbs +16 -0
  467. data/sig/mindee/product/fr/payslip/payslip_v3_document.rbs +26 -0
  468. data/sig/mindee/product/fr/payslip/payslip_v3_employee.rbs +20 -0
  469. data/sig/mindee/product/fr/payslip/payslip_v3_employer.rbs +20 -0
  470. data/sig/mindee/product/fr/payslip/payslip_v3_employment.rbs +20 -0
  471. data/sig/mindee/product/fr/payslip/payslip_v3_page.rbs +17 -0
  472. data/sig/mindee/product/fr/payslip/payslip_v3_paid_time_off.rbs +20 -0
  473. data/sig/mindee/product/fr/payslip/payslip_v3_paid_time_offs.rbs +15 -0
  474. data/sig/mindee/product/fr/payslip/payslip_v3_pay_detail.rbs +23 -0
  475. data/sig/mindee/product/fr/payslip/payslip_v3_pay_period.rbs +18 -0
  476. data/sig/mindee/product/fr/payslip/payslip_v3_salary_detail.rbs +20 -0
  477. data/sig/mindee/product/fr/payslip/payslip_v3_salary_details.rbs +15 -0
  478. data/sig/mindee/product/ind/indian_passport/indian_passport_v1.rbs +13 -0
  479. data/sig/mindee/product/ind/indian_passport/indian_passport_v1_document.rbs +37 -0
  480. data/sig/mindee/product/ind/indian_passport/indian_passport_v1_page.rbs +17 -0
  481. data/sig/mindee/product/international_id/international_id_v2.rbs +11 -0
  482. data/sig/mindee/product/international_id/international_id_v2_document.rbs +29 -0
  483. data/sig/mindee/product/international_id/international_id_v2_page.rbs +15 -0
  484. data/sig/mindee/product/invoice/invoice_v4.rbs +11 -0
  485. data/sig/mindee/product/invoice/invoice_v4_document.rbs +40 -0
  486. data/sig/mindee/product/invoice/invoice_v4_line_item.rbs +21 -0
  487. data/sig/mindee/product/invoice/invoice_v4_line_items.rbs +13 -0
  488. data/sig/mindee/product/invoice/invoice_v4_page.rbs +15 -0
  489. data/sig/mindee/product/invoice_splitter/invoice_splitter_v1.rbs +14 -0
  490. data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_document.rbs +19 -0
  491. data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_page.rbs +13 -0
  492. data/sig/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.rbs +11 -0
  493. data/sig/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_document.rbs +13 -0
  494. data/sig/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_page.rbs +15 -0
  495. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1.rbs +11 -0
  496. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rbs +14 -0
  497. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rbs +14 -0
  498. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rbs +14 -0
  499. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rbs +14 -0
  500. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_document.rbs +28 -0
  501. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rbs +18 -0
  502. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rbs +13 -0
  503. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_page.rbs +15 -0
  504. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rbs +14 -0
  505. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rbs +14 -0
  506. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rbs +13 -0
  507. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rbs +15 -0
  508. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rbs +14 -0
  509. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rbs +14 -0
  510. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rbs +14 -0
  511. data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rbs +14 -0
  512. data/sig/mindee/product/passport/passport_v1.rbs +11 -0
  513. data/sig/mindee/product/passport/passport_v1_document.rbs +23 -0
  514. data/sig/mindee/product/passport/passport_v1_page.rbs +15 -0
  515. data/sig/mindee/product/receipt/receipt_v5.rbs +11 -0
  516. data/sig/mindee/product/receipt/receipt_v5_document.rbs +31 -0
  517. data/sig/mindee/product/receipt/receipt_v5_line_item.rbs +17 -0
  518. data/sig/mindee/product/receipt/receipt_v5_line_items.rbs +13 -0
  519. data/sig/mindee/product/receipt/receipt_v5_page.rbs +15 -0
  520. data/sig/mindee/product/resume/resume_v1.rbs +11 -0
  521. data/sig/mindee/product/resume/resume_v1_certificate.rbs +17 -0
  522. data/sig/mindee/product/resume/resume_v1_certificates.rbs +13 -0
  523. data/sig/mindee/product/resume/resume_v1_document.rbs +39 -0
  524. data/sig/mindee/product/resume/resume_v1_education.rbs +20 -0
  525. data/sig/mindee/product/resume/resume_v1_educations.rbs +13 -0
  526. data/sig/mindee/product/resume/resume_v1_language.rbs +15 -0
  527. data/sig/mindee/product/resume/resume_v1_languages.rbs +13 -0
  528. data/sig/mindee/product/resume/resume_v1_page.rbs +15 -0
  529. data/sig/mindee/product/resume/resume_v1_professional_experience.rbs +22 -0
  530. data/sig/mindee/product/resume/resume_v1_professional_experiences.rbs +13 -0
  531. data/sig/mindee/product/resume/resume_v1_social_networks_url.rbs +15 -0
  532. data/sig/mindee/product/resume/resume_v1_social_networks_urls.rbs +13 -0
  533. data/sig/mindee/product/universal/universal.rbs +14 -0
  534. data/sig/mindee/product/universal/universal_document.rbs +10 -0
  535. data/sig/mindee/product/universal/universal_page.rbs +14 -0
  536. data/sig/mindee/product/universal/universal_prediction.rbs +19 -0
  537. data/sig/mindee/product/us/bank_check/bank_check_v1.rbs +13 -0
  538. data/sig/mindee/product/us/bank_check/bank_check_v1_document.rbs +20 -0
  539. data/sig/mindee/product/us/bank_check/bank_check_v1_page.rbs +19 -0
  540. data/sig/mindee/product/us/healthcare_card/healthcare_card_v1.rbs +13 -0
  541. data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rbs +17 -0
  542. data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rbs +15 -0
  543. data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_document.rbs +28 -0
  544. data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_page.rbs +17 -0
  545. data/sig/mindee/product/us/us_mail/us_mail_v3.rbs +13 -0
  546. data/sig/mindee/product/us/us_mail/us_mail_v3_document.rbs +21 -0
  547. data/sig/mindee/product/us/us_mail/us_mail_v3_page.rbs +17 -0
  548. data/sig/mindee/product/us/us_mail/us_mail_v3_recipient_address.rbs +23 -0
  549. data/sig/mindee/product/us/us_mail/us_mail_v3_recipient_addresses.rbs +15 -0
  550. data/sig/mindee/product/us/us_mail/us_mail_v3_sender_address.rbs +18 -0
  551. data/sig/mindee/product/us/w9/w9_v1.rbs +13 -0
  552. data/sig/mindee/product/us/w9/w9_v1_document.rbs +14 -0
  553. data/sig/mindee/product/us/w9/w9_v1_page.rbs +29 -0
  554. data/sig/mindee/version.rbs +6 -0
  555. data/sig/mindee.rbs +59 -0
  556. metadata +390 -104
  557. data/docs/bank_statement_fr_v1.md +0 -178
  558. data/docs/code_samples/bank_statement_fr_v1_async.txt +0 -19
  559. data/docs/code_samples/custom_v1.txt +0 -33
  560. data/docs/code_samples/eu_driver_license_v1.txt +0 -19
  561. data/docs/code_samples/expense_receipts_v4.txt +0 -19
  562. data/docs/code_samples/proof_of_address_v1.txt +0 -19
  563. data/docs/code_samples/us_driver_license_v1.txt +0 -19
  564. data/docs/code_samples/us_mail_v2_async.txt +0 -19
  565. data/docs/code_samples/workflow_execution.txt +0 -29
  566. data/docs/custom_v1.md +0 -111
  567. data/docs/payslip_fra_v2.md +0 -294
  568. data/lib/mindee/extraction/common.rb +0 -4
  569. data/lib/mindee/extraction/multi_receipts_extractor/multi_receipts_extractor.rb +0 -32
  570. data/lib/mindee/extraction/pdf_extractor.rb +0 -4
  571. data/lib/mindee/extraction/tax_extractor/ocr_extractor.rb +0 -110
  572. data/lib/mindee/extraction/tax_extractor/tax_extractor.rb +0 -338
  573. data/lib/mindee/extraction/tax_extractor.rb +0 -3
  574. data/lib/mindee/parsing/custom/classification_field.rb +0 -28
  575. data/lib/mindee/parsing/custom/list_field.rb +0 -78
  576. data/lib/mindee/parsing/custom.rb +0 -4
  577. data/lib/mindee/parsing/generated.rb +0 -4
  578. data/lib/mindee/product/custom/custom_v1.rb +0 -36
  579. data/lib/mindee/product/custom/custom_v1_document.rb +0 -60
  580. data/lib/mindee/product/custom/custom_v1_page.rb +0 -32
  581. data/lib/mindee/product/eu/driver_license/driver_license_v1.rb +0 -41
  582. data/lib/mindee/product/eu/driver_license/driver_license_v1_document.rb +0 -88
  583. data/lib/mindee/product/eu/driver_license/driver_license_v1_page.rb +0 -53
  584. data/lib/mindee/product/fr/bank_statement/bank_statement_v1.rb +0 -41
  585. data/lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb +0 -130
  586. data/lib/mindee/product/fr/bank_statement/bank_statement_v1_page.rb +0 -34
  587. data/lib/mindee/product/fr/bank_statement/bank_statement_v1_transaction.rb +0 -64
  588. data/lib/mindee/product/generated/generated_v1.rb +0 -38
  589. data/lib/mindee/product/generated/generated_v1_document.rb +0 -35
  590. data/lib/mindee/product/proof_of_address/proof_of_address_v1.rb +0 -39
  591. data/lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb +0 -83
  592. data/lib/mindee/product/proof_of_address/proof_of_address_v1_page.rb +0 -32
  593. data/lib/mindee/product/receipt/receipt_v4.rb +0 -36
  594. data/lib/mindee/product/receipt/receipt_v4_document.rb +0 -86
  595. data/lib/mindee/product/receipt/receipt_v4_page.rb +0 -32
  596. data/lib/mindee/product/us/driver_license/driver_license_v1.rb +0 -41
  597. data/lib/mindee/product/us/driver_license/driver_license_v1_document.rb +0 -113
  598. data/lib/mindee/product/us/driver_license/driver_license_v1_page.rb +0 -53
  599. data/lib/mindee/product/us/us_mail/us_mail_v2.rb +0 -41
  600. data/lib/mindee/product/us/us_mail/us_mail_v2_document.rb +0 -100
  601. data/lib/mindee/product/us/us_mail/us_mail_v2_page.rb +0 -34
  602. data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_address.rb +0 -105
  603. data/lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb +0 -66
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: Ruby Getting Started
2
+ title: Getting Started
3
3
  category: 622b805aaec68102ea7fcbc2
4
4
  slug: ruby-getting-started
5
5
  parentDoc: 6294d97ee723f1008d2ab28e
@@ -9,10 +9,10 @@ This guide will help you get the most out of the Mindee Ruby client library to e
9
9
  ## Installation
10
10
 
11
11
  ### Requirements
12
- The following Ruby versions are tested and supported: 2.6, 2.7, 3.0, 3.1, 3.2
12
+ The following Ruby versions are tested and supported: 3.0, 3.1, 3.2, 3.3
13
13
 
14
14
  ### Standard Installation
15
- To quickly get started with the Ruby OCR SDK, Install by adding this line to your application's Gemfile:
15
+ To quickly get started with the Ruby Client Library, Install by adding this line to your application's Gemfile:
16
16
 
17
17
  ```shell
18
18
  gem 'mindee'
@@ -75,7 +75,8 @@ Using Mindee's APIs can be broken down into the following steps:
75
75
  Let's take a deep dive into how this works.
76
76
 
77
77
  ## Initializing the Client
78
- The `Client` automatically connects to the default endpoints for each product (or creates one with given parameters for Custom APIs).
78
+ The `Client` automatically connects to the default endpoints for each product (or creates one with given parameters for
79
+ Universal APIs).
79
80
 
80
81
  The `Client` requires your [API key](https://developers.mindee.com/docs/make-your-first-request#create-an-api-key).
81
82
 
@@ -83,7 +84,7 @@ You can either pass these directly to the constructor or through environment var
83
84
 
84
85
 
85
86
  ### Pass the API key directly
86
- ```ruby
87
+ ```rb
87
88
  # Init a new client and passing the key directly
88
89
  mindee_client = Mindee::Client.new(api_key: 'my-api-key')
89
90
  ```
@@ -97,7 +98,7 @@ MINDEE_API_KEY=my-api-key
97
98
  ```
98
99
 
99
100
  Then in your code:
100
- ```ruby
101
+ ```rb
101
102
  # Init a new client without an API key
102
103
  mindee_client = Mindee::Client.new
103
104
  ```
@@ -118,86 +119,33 @@ all supported types automatically.
118
119
  Once a document is loaded, interacting with it is done in exactly the same way, regardless
119
120
  of how it was loaded.
120
121
 
121
- There are a few different ways of loading a document file, depending on your use case:
122
-
123
- * [Path](#path)
124
- * [File Object](#file-object)
125
- * [Base64](#base64)
126
- * [Bytes](#bytes)
127
- * [Urls](#url)
128
-
129
- ### Path
130
- Load from a file directly from disk. Requires an absolute path, as a string.
131
-
132
- ```ruby
133
- # Init a new client
134
- mindee_client = Mindee::Client.new(api_key: 'my-api-key')
135
-
136
- # Load a file from disk
137
- input_source = mindee_client.source_from_path('/path/to/the/file.ext')
138
-
139
- # Parse the file
140
- result = mindee_client.parse(
141
- input_source,
142
- Mindee::Product::Invoice::InvoiceV4
143
- )
144
- # Print a full summary of the parsed data in RST format
145
- puts result.document
146
- ```
147
-
148
- ### File Object
149
- A normal Ruby file object with a path. Must be in binary mode.
122
+ There are a few different ways of loading a document file, depending on your use case, you can use a:
150
123
 
151
- **Note**: The original filename is required when calling the method.
124
+ * [File path](https://developers.mindee.com/docs/ruby-document-loading#loading-from-a-local-path): using the Mindee Client's `source_from_path()` method.
125
+ * [File Object](https://developers.mindee.com/docs/ruby-document-loading#loading-from-a-file-object): using the Mindee Client's `source_from_file()` method.
126
+ * [Base64 String](https://developers.mindee.com/docs/ruby-document-loading#loading-from-a-base64-encoded-string): using the Mindee Client's `source_from_b64string()` method.
127
+ * [Raw Byte sequence](https://developers.mindee.com/docs/ruby-document-loading#loading-from-raw-bytes): using the Mindee Client's `source_from_bytes()` method.
128
+ * [URL](https://developers.mindee.com/docs/ruby-document-loading#loading-by-url): using the Mindee Client's `source_from_url()` method.
152
129
 
153
- ```ruby
154
- File.open(INVOICE_FILE, 'rb') do |fo|
155
- input_source = mindee_client.source_from_file(fo, "invoice.jpg")
156
- end
130
+ More details about file loading on the [dedicated page](https://developers.mindee.com/docs/ruby-document-loading).
157
131
 
158
- result = mindee_client.parse(
159
- input_source,
160
- Mindee::Product::Invoice::InvoiceV4
161
- )
162
- ```
163
-
164
- ### Base64
165
- Load file contents from a base64-encoded string.
166
-
167
- **Note**: The original filename is required when calling the method.
168
-
169
- ```ruby
170
- b64_string = "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLD...."
171
-
172
- input_source = mindee_client.source_from_b64string(b64_string, "receipt.jpg")
173
-
174
- result = mindee_client.parse(
175
- input_source,
176
- Mindee::Product::Receipt::ReceiptV5
177
- )
178
- ```
132
+ ## Sending a File
133
+ To send a file to the API, we need to specify how to process the document.
134
+ This will determine which API endpoint is used and how the API return will be handled internally by the library.
179
135
 
180
- ### Bytes
181
- Requires raw bytes.
136
+ More specifically, we need to set a `Mindee::Product` class as the first parameter of the `create_endpoint` method.
182
137
 
183
- **Note**: The original filename is required when calling the method.
138
+ This is because the `Endpoint`'s urls will be set according to it
184
139
 
185
- ```ruby
186
- raw_bytes = b"%PDF-1.3\n%\xbf\xf7\xa2\xfe\n1 0 ob..."
187
- input_source = mindee_client.source_from_bytes(raw_bytes, "invoice.pdf")
140
+ Each document type available in the library has its corresponding class, which inherit from the base
141
+ `Mindee::Parsing::Common::Predict` class.
188
142
 
189
- result = mindee_client.parse(
190
- input_source,
191
- Mindee::Product::Invoice::InvoiceV4
192
- )
193
- ```
143
+ This is detailed in each document-specific guide.
194
144
 
195
- ### URL
196
- Requires an url as a String.
145
+ ### Off-the-Shelf Documents
146
+ Simply setting the correct class is enough:
197
147
 
198
- **Note**: the url must start with `https://`.
199
- ```ruby
200
- input_source = mindee_client.source_from_url("https://www.example.com/invoice.pdf")
148
+ ```rb
201
149
 
202
150
  result = mindee_client.parse(
203
151
  input_source,
@@ -205,44 +153,42 @@ result = mindee_client.parse(
205
153
  )
206
154
  ```
207
155
 
208
- ## Sending a File
209
- To send a file to the API, we need to specify how to process the document.
210
- This will determine which API endpoint is used and how the API return will be handled internally by the library.
211
-
212
- More specifically, we need to set a `Mindee::Product` class as the first parameter of the `create_endpoint` method.
213
-
214
- This is because the `Endpoint`'s urls will be set according to it
215
-
216
- Each document type available in the library has its corresponding class, which inherit from the base `Mindee::Parsing::Common::Predict` class.
217
- This is detailed in each document-specific guide.
156
+ #### Specific call method
157
+ Some products, such as InvoiceV4, ReceiptV5 & FinancialDocumentV1 support both asynchronous polling and synchronous
158
+ HTTP calls.
159
+ We recommend letting the client library decide which is better by default, but you can override the behavior by setting
160
+ the `enqueue` parameter to `true` or `false`.
218
161
 
219
- ### Off-the-Shelf Documents
220
- Simply setting the correct class is enough:
221
- ```ruby
162
+ ```rb
222
163
 
223
164
  result = mindee_client.parse(
224
165
  input_source,
225
- Mindee::Product::Invoice::InvoiceV4
166
+ Mindee::Product::Invoice::InvoiceV4,
167
+ enqueue: false
226
168
  )
227
169
  ```
228
170
 
229
- ### Custom Documents (docTI)
171
+ > 🚧 WARNING: this feature is not available for all products, and may result in errors if used inappropriately.
172
+ > Only use it if you are certain of what you are doing.
173
+ ### Universal Documents (docTI)
230
174
  For custom documents, the endpoint to use must also be set, and it must take in an `endpoint_name`:
231
175
 
232
- ```ruby
176
+ ```rb
233
177
  endpoint = mindee_client.create_endpoint(endpoint_name: 'wnine', account_name: 'my-account')
234
178
 
235
- result = mindee_client.enqueue_and_parse(
179
+ result = mindee_client.parse(
236
180
  input_source,
237
- Mindee::Product::Generated::GeneratedV1,
181
+ Mindee::Product::Universal::Universal,
238
182
  endpoint: endpoint
239
183
  )
240
184
  ```
241
185
 
242
- This is because the `GeneratedV1` class is enough to handle the return processing, but the actual endpoint needs to be specified.
186
+ This is because the `Universal` class is enough to handle the return processing, but the actual endpoint needs to be
187
+ specified.
243
188
 
244
189
  ## Process the Result
245
- The response object is common to all documents, including custom documents. The main properties are:
190
+ The response object is common to all documents, including custom documents (using the Universal product). The main
191
+ properties are:
246
192
 
247
193
  * `id` — Mindee ID of the document
248
194
  * `name` — Filename sent to the API
@@ -261,7 +207,7 @@ It contains the data extracted from the entire document, all pages combined.
261
207
  It's possible to have the same field in various pages, but at the document level,
262
208
  only the highest confidence field data will be shown (this is all done automatically at the API level).
263
209
 
264
- ```ruby
210
+ ```rb
265
211
  # as an object, complete
266
212
  pp result.document.inference.prediction
267
213
 
@@ -279,7 +225,7 @@ All response objects have this property, regardless of the number of pages.
279
225
  Single page documents will have a single entry.
280
226
 
281
227
  Iteration is done like any Ruby array:
282
- ```ruby
228
+ ```rb
283
229
  response.document.inference.pages.each do |page|
284
230
  # as an object, complete
285
231
  pp page.prediction
@@ -290,36 +236,22 @@ end
290
236
  ```
291
237
 
292
238
  #### Page Orientation
293
- The orientation field is only available at the page level as it describes whether the page image should be rotated to be upright.
239
+ The orientation field is only available at the page level as it describes whether the page image should be rotated to
240
+ be upright.
294
241
 
295
- If the page requires rotation for correct display, the orientation field gives a prediction among these 3 possible outputs:
242
+ If the page requires rotation for correct display, the orientation field gives a prediction among these 3 possible
243
+ outputs:
296
244
 
297
245
  * 0 degrees: the page is already upright
298
246
  * 90 degrees: the page must be rotated clockwise to be upright
299
247
  * 270 degrees: the page must be rotated counterclockwise to be upright
300
248
 
301
- ```ruby
249
+ ```rb
302
250
  response.document.inference.pages.each do |page|
303
251
  puts page.orientation.value
304
252
  end
305
253
  ```
306
254
 
307
- ## 🧪 Experimental Features
308
-
309
- ### PDF repair
310
-
311
- Some PDF files might appear fine on your computer, but can be rejected by the server.
312
- This _experimental_ feature attempts to fix the file's header information before sending it to the server.
313
-
314
- > ⚠️ **Warning**: This feature copies your file and then **alters** it. The original file will be left alone, but the copy might get partially corrupted, and improperly parsed as a result. Use at your own discretion.
315
-
316
- To enable it, simply set the `fix_pdf` flag to `true` during source creation:
317
-
318
- ```rb
319
- input_source = mindee_client.source_from_file(input_file, "name-of-my-file.ext", fix_pdf: true)
320
- ```
321
-
322
- Note: This only works for local files, files sent by URL will not be processed.
323
255
 
324
256
  ## Questions?
325
257
  [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -1,16 +1,34 @@
1
1
  ---
2
- title: Barcode Reader OCR Ruby
2
+ title: Ruby Client Library - Barcode Reader
3
3
  category: 622b805aaec68102ea7fcbc2
4
4
  slug: ruby-barcode-reader-ocr
5
- parentDoc: 6294d97ee723f1008d2ab28e
5
+ parentDoc: 67b49df15b843f3fa9cd622b
6
6
  ---
7
- The Ruby OCR SDK supports the [Barcode Reader API](https://platform.mindee.com/mindee/barcode_reader).
7
+ The Ruby Client Library supports the [Barcode Reader API](https://platform.mindee.com/mindee/barcode_reader).
8
8
 
9
- Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/barcode_reader/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
9
+
10
+ > 📝 Product Specs
11
+ >
12
+ > | Specification | Details |
13
+ > | ------------------------------ | -------------------------------------------------- |
14
+ > | Endpoint Name | `barcode_reader` |
15
+ > | Recommended Version | `v1.0` |
16
+ > | Supports Polling/Webhooks | ❌ No |
17
+ > | Support Synchronous HTTP Calls | ✔️ Yes |
18
+ > | Geography | 🌐 Global |
19
+
20
+
21
+ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/barcode_reader/default_sample.jpg),
22
+ we are going to illustrate how to extract the data that we want using the Ruby Client Library.
10
23
  ![Barcode Reader sample](https://github.com/mindee/client-lib-test-data/blob/main/products/barcode_reader/default_sample.jpg?raw=true)
11
24
 
12
25
  # Quick-Start
13
26
  ```rb
27
+ #
28
+ # Install the Ruby client library by running:
29
+ # gem install mindee
30
+ #
31
+
14
32
  require 'mindee'
15
33
 
16
34
  # Init a new client
@@ -30,7 +48,6 @@ puts result.document
30
48
 
31
49
  # Print the document-level parsed data
32
50
  # puts result.document.inference.prediction
33
-
34
51
  ```
35
52
 
36
53
  **Output (RST):**
@@ -70,12 +87,12 @@ These fields are generic and used in several products.
70
87
  Each prediction object contains a set of fields that inherit from the generic `Field` class.
71
88
  A typical `Field` object will have the following attributes:
72
89
 
73
- * **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
90
+ * **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted.
74
91
  * **confidence** (Float, nil): the confidence score of the field prediction.
75
92
  * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
76
93
  * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
77
94
  * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
78
- * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
95
+ * **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it).
79
96
 
80
97
 
81
98
  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.
@@ -90,7 +107,7 @@ The following fields are extracted for Barcode Reader V1:
90
107
  **codes_1d** (Array<[StringField](#string-field)>): List of decoded 1D barcodes.
91
108
 
92
109
  ```rb
93
- for codes_1d_elem in result.document.inference.prediction.codes_1d do
110
+ result.document.inference.prediction.codes_1d do |codes_1d_elem|
94
111
  puts codes_1d_elem.value
95
112
  end
96
113
  ```
@@ -99,7 +116,7 @@ end
99
116
  **codes_2d** (Array<[StringField](#string-field)>): List of decoded 2D barcodes.
100
117
 
101
118
  ```rb
102
- for codes_2d_elem in result.document.inference.prediction.codes_2d do
119
+ result.document.inference.prediction.codes_2d do |codes_2d_elem|
103
120
  puts codes_2d_elem.value
104
121
  end
105
122
  ```
@@ -1,16 +1,42 @@
1
1
  ---
2
- title: Bill of Lading OCR Ruby
2
+ title: Ruby Client Library - Bill of Lading
3
3
  category: 622b805aaec68102ea7fcbc2
4
4
  slug: ruby-bill-of-lading-ocr
5
- parentDoc: 6294d97ee723f1008d2ab28e
5
+ parentDoc: 67b49df15b843f3fa9cd622b
6
6
  ---
7
- The Ruby OCR SDK supports the [Bill of Lading API](https://platform.mindee.com/mindee/bill_of_lading).
8
-
9
- Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
7
+ The Ruby Client Library supports the [Bill of Lading API](https://platform.mindee.com/mindee/bill_of_lading).
8
+
9
+
10
+ > 📝 Product Specs
11
+ >
12
+ > | Specification | Details |
13
+ > | ------------------------------ | -------------------------------------------------- |
14
+ > | Endpoint Name | `bill_of_lading` |
15
+ > | Recommended Version | `v1.1` |
16
+ > | Supports Polling/Webhooks | ✔️ Yes |
17
+ > | Support Synchronous HTTP Calls | ❌ No |
18
+ > | Geography | 🌐 Global |
19
+
20
+ > 🔐 Polling Limitations
21
+ >
22
+ > | Setting | Parameter name | Default Value |
23
+ > | ------------------------------- | ----------------------- | ------------- |
24
+ > | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds |
25
+ > | Default Delay Between Calls | `delay_sec` | 1.5 seconds |
26
+ > | Polling Attempts Before Timeout | `max_retries` | 80 retries |
27
+
28
+
29
+ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg),
30
+ we are going to illustrate how to extract the data that we want using the Ruby Client Library.
10
31
  ![Bill of Lading sample](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg?raw=true)
11
32
 
12
33
  # Quick-Start
13
34
  ```rb
35
+ #
36
+ # Install the Ruby client library by running:
37
+ # gem install mindee
38
+ #
39
+
14
40
  require 'mindee'
15
41
 
16
42
  # Init a new client
@@ -20,7 +46,7 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
20
46
  input_source = mindee_client.source_from_path('/path/to/the/file.ext')
21
47
 
22
48
  # Parse the file
23
- result = mindee_client.enqueue_and_parse(
49
+ result = mindee_client.parse(
24
50
  input_source,
25
51
  Mindee::Product::BillOfLading::BillOfLadingV1
26
52
  )
@@ -30,7 +56,6 @@ puts result.document
30
56
 
31
57
  # Print the document-level parsed data
32
58
  # puts result.document.inference.prediction
33
-
34
59
  ```
35
60
 
36
61
  **Output (RST):**
@@ -89,18 +114,18 @@ These fields are generic and used in several products.
89
114
  Each prediction object contains a set of fields that inherit from the generic `Field` class.
90
115
  A typical `Field` object will have the following attributes:
91
116
 
92
- * **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
117
+ * **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted.
93
118
  * **confidence** (Float, nil): the confidence score of the field prediction.
94
119
  * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
95
120
  * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
96
121
  * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
97
- * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
122
+ * **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it).
98
123
 
99
124
 
100
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.
101
126
 
102
127
  ### Date Field
103
- Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
128
+ Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
104
129
 
105
130
  * **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
106
131
 
@@ -110,14 +135,15 @@ The text field `StringField` only has one constraint: it's **value** is a `Strin
110
135
  ## Specific Fields
111
136
  Fields which are specific to this product; they are not used in any other product.
112
137
 
113
- ### Carrier Field
114
- The shipping company responsible for transporting the goods.
138
+ ### Shipper Field
139
+ The party responsible for shipping the goods.
115
140
 
116
- A `BillOfLadingV1Carrier` implements the following attributes:
141
+ A `BillOfLadingV1Shipper` implements the following attributes:
117
142
 
118
- * `name` (String): The name of the carrier.
119
- * `professional_number` (String): The professional number of the carrier.
120
- * `scac` (String): The Standard Carrier Alpha Code (SCAC) of the carrier.
143
+ * `address` (String): The address of the shipper.
144
+ * `email` (String): The email of the shipper.
145
+ * `name` (String): The name of the shipper.
146
+ * `phone` (String): The phone number of the shipper.
121
147
  Fields which are specific to this product; they are not used in any other product.
122
148
 
123
149
  ### Consignee Field
@@ -131,19 +157,6 @@ A `BillOfLadingV1Consignee` implements the following attributes:
131
157
  * `phone` (String): The phone number of the consignee.
132
158
  Fields which are specific to this product; they are not used in any other product.
133
159
 
134
- ### Items Field
135
- The goods being shipped.
136
-
137
- A `BillOfLadingV1CarrierItem` implements the following attributes:
138
-
139
- * `description` (String): A description of the item.
140
- * `gross_weight` (Float): The gross weight of the item.
141
- * `measurement` (Float): The measurement of the item.
142
- * `measurement_unit` (String): The unit of measurement for the measurement.
143
- * `quantity` (Float): The quantity of the item being shipped.
144
- * `weight_unit` (String): The unit of measurement for weights.
145
- Fields which are specific to this product; they are not used in any other product.
146
-
147
160
  ### Notify Party Field
148
161
  The party to be notified of the arrival of the goods.
149
162
 
@@ -155,15 +168,27 @@ A `BillOfLadingV1NotifyParty` implements the following attributes:
155
168
  * `phone` (String): The phone number of the notify party.
156
169
  Fields which are specific to this product; they are not used in any other product.
157
170
 
158
- ### Shipper Field
159
- The party responsible for shipping the goods.
171
+ ### Carrier Field
172
+ The shipping company responsible for transporting the goods.
160
173
 
161
- A `BillOfLadingV1Shipper` implements the following attributes:
174
+ A `BillOfLadingV1Carrier` implements the following attributes:
162
175
 
163
- * `address` (String): The address of the shipper.
164
- * `email` (String): The email of the shipper.
165
- * `name` (String): The name of the shipper.
166
- * `phone` (String): The phone number of the shipper.
176
+ * `name` (String): The name of the carrier.
177
+ * `professional_number` (String): The professional number of the carrier.
178
+ * `scac` (String): The Standard Carrier Alpha Code (SCAC) of the carrier.
179
+ Fields which are specific to this product; they are not used in any other product.
180
+
181
+ ### Items Field
182
+ The goods being shipped.
183
+
184
+ A `BillOfLadingV1CarrierItem` implements the following attributes:
185
+
186
+ * `description` (String): A description of the item.
187
+ * `gross_weight` (Float): The gross weight of the item.
188
+ * `measurement` (Float): The measurement of the item.
189
+ * `measurement_unit` (String): The unit of measurement for the measurement.
190
+ * `quantity` (Float): The quantity of the item being shipped.
191
+ * `weight_unit` (String): The unit of measurement for weights.
167
192
 
168
193
  # Attributes
169
194
  The following fields are extracted for Bill of Lading V1:
@@ -186,7 +211,7 @@ puts result.document.inference.prediction.carrier.value
186
211
  **carrier_items** (Array<[BillOfLadingV1CarrierItem](#items-field)>): The goods being shipped.
187
212
 
188
213
  ```rb
189
- for carrier_items_elem in result.document.inference.prediction.carrier_items do
214
+ result.document.inference.prediction.carrier_items do |carrier_items_elem|
190
215
  puts carrier_items_elem.value
191
216
  end
192
217
  ```
@@ -1,16 +1,42 @@
1
1
  ---
2
- title: Business Card OCR Ruby
2
+ title: Ruby Client Library - Business Card
3
3
  category: 622b805aaec68102ea7fcbc2
4
4
  slug: ruby-business-card-ocr
5
- parentDoc: 6294d97ee723f1008d2ab28e
5
+ parentDoc: 67b49df15b843f3fa9cd622b
6
6
  ---
7
- The Ruby OCR SDK supports the [Business Card API](https://platform.mindee.com/mindee/business_card).
8
-
9
- Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/business_card/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
7
+ The Ruby Client Library supports the [Business Card API](https://platform.mindee.com/mindee/business_card).
8
+
9
+
10
+ > 📝 Product Specs
11
+ >
12
+ > | Specification | Details |
13
+ > | ------------------------------ | -------------------------------------------------- |
14
+ > | Endpoint Name | `business_card` |
15
+ > | Recommended Version | `v1.0` |
16
+ > | Supports Polling/Webhooks | ✔️ Yes |
17
+ > | Support Synchronous HTTP Calls | ❌ No |
18
+ > | Geography | 🌐 Global |
19
+
20
+ > 🔐 Polling Limitations
21
+ >
22
+ > | Setting | Parameter name | Default Value |
23
+ > | ------------------------------- | ----------------------- | ------------- |
24
+ > | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds |
25
+ > | Default Delay Between Calls | `delay_sec` | 1.5 seconds |
26
+ > | Polling Attempts Before Timeout | `max_retries` | 80 retries |
27
+
28
+
29
+ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/business_card/default_sample.jpg),
30
+ we are going to illustrate how to extract the data that we want using the Ruby Client Library.
10
31
  ![Business Card sample](https://github.com/mindee/client-lib-test-data/blob/main/products/business_card/default_sample.jpg?raw=true)
11
32
 
12
33
  # Quick-Start
13
34
  ```rb
35
+ #
36
+ # Install the Ruby client library by running:
37
+ # gem install mindee
38
+ #
39
+
14
40
  require 'mindee'
15
41
 
16
42
  # Init a new client
@@ -20,7 +46,7 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
20
46
  input_source = mindee_client.source_from_path('/path/to/the/file.ext')
21
47
 
22
48
  # Parse the file
23
- result = mindee_client.enqueue_and_parse(
49
+ result = mindee_client.parse(
24
50
  input_source,
25
51
  Mindee::Product::BusinessCard::BusinessCardV1
26
52
  )
@@ -30,7 +56,6 @@ puts result.document
30
56
 
31
57
  # Print the document-level parsed data
32
58
  # puts result.document.inference.prediction
33
-
34
59
  ```
35
60
 
36
61
  **Output (RST):**
@@ -70,12 +95,12 @@ These fields are generic and used in several products.
70
95
  Each prediction object contains a set of fields that inherit from the generic `Field` class.
71
96
  A typical `Field` object will have the following attributes:
72
97
 
73
- * **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
98
+ * **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted.
74
99
  * **confidence** (Float, nil): the confidence score of the field prediction.
75
100
  * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
76
101
  * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
77
102
  * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
78
- * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
103
+ * **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it).
79
104
 
80
105
 
81
106
  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.
@@ -153,7 +178,7 @@ puts result.document.inference.prediction.phone_number.value
153
178
  **social_media** (Array<[StringField](#string-field)>): The social media profiles of the person or company.
154
179
 
155
180
  ```rb
156
- for social_media_elem in result.document.inference.prediction.social_media do
181
+ result.document.inference.prediction.social_media do |social_media_elem|
157
182
  puts social_media_elem.value
158
183
  end
159
184
  ```