mindee 3.19.1 → 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.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -1
- data/CHANGELOG.md +28 -0
- data/README.md +42 -52
- data/Steepfile +31 -0
- data/bin/mindee.rb +30 -62
- data/docs/advanced_file_operations.md +111 -0
- data/docs/code_samples/bank_account_details_v1.txt +5 -0
- data/docs/code_samples/bank_account_details_v2.txt +5 -0
- data/docs/code_samples/bank_check_v1.txt +5 -0
- data/docs/code_samples/{us_driver_license_v1.txt → bank_statement_fr_v2_async.txt} +6 -1
- data/docs/code_samples/barcode_reader_v1.txt +5 -0
- data/docs/code_samples/bill_of_lading_v1_async.txt +6 -1
- data/docs/code_samples/business_card_v1_async.txt +6 -1
- data/docs/code_samples/carte_grise_v1.txt +5 -0
- data/docs/code_samples/cropper_v1.txt +5 -0
- data/docs/code_samples/default.txt +8 -2
- data/docs/code_samples/default_async.txt +7 -2
- data/docs/code_samples/delivery_notes_v1_async.txt +6 -1
- data/docs/code_samples/driver_license_v1_async.txt +6 -1
- data/docs/code_samples/energy_bill_fra_v1_async.txt +6 -1
- data/docs/code_samples/expense_receipts_v5.txt +7 -1
- data/docs/code_samples/expense_receipts_v5_async.txt +6 -1
- data/docs/code_samples/financial_document_v1.txt +7 -1
- data/docs/code_samples/financial_document_v1_async.txt +6 -1
- data/docs/code_samples/french_healthcard_v1_async.txt +6 -1
- data/docs/code_samples/idcard_fr_v1.txt +5 -0
- data/docs/code_samples/idcard_fr_v2.txt +5 -0
- data/docs/code_samples/ind_passport_v1_async.txt +6 -1
- data/docs/code_samples/international_id_v2_async.txt +6 -1
- data/docs/code_samples/invoice_splitter_v1_async.txt +6 -1
- data/docs/code_samples/invoices_v4.txt +7 -1
- data/docs/code_samples/invoices_v4_async.txt +6 -1
- data/docs/code_samples/license_plates_v1.txt +5 -0
- data/docs/code_samples/multi_receipts_detector_v1.txt +5 -0
- data/docs/code_samples/nutrition_facts_v1_async.txt +6 -1
- data/docs/code_samples/passport_v1.txt +5 -0
- data/docs/code_samples/payslip_fra_v2_async.txt +6 -1
- data/docs/code_samples/payslip_fra_v3_async.txt +6 -1
- data/docs/code_samples/resume_v1_async.txt +6 -1
- data/docs/code_samples/us_healthcare_cards_v1_async.txt +6 -1
- data/docs/code_samples/us_mail_v3_async.txt +6 -1
- data/docs/code_samples/us_w9_v1.txt +5 -0
- data/docs/getting_started.md +50 -118
- data/docs/{barcode_reader_v1.md → global_products/barcode_reader_v1.md} +26 -9
- data/docs/{bill_of_lading_v1.md → global_products/bill_of_lading_v1.md} +62 -37
- data/docs/{business_card_v1.md → global_products/business_card_v1.md} +35 -10
- data/docs/{cropper_v1.md → global_products/cropper_v1.md} +32 -13
- data/docs/{delivery_notes_v1.md → global_products/delivery_notes_v1.md} +35 -10
- data/docs/{driver_license_v1.md → global_products/driver_license_v1.md} +65 -9
- data/docs/{expense_receipts_v5.md → global_products/expense_receipts_v5.md} +57 -21
- data/docs/{financial_document_v1.md → global_products/financial_document_v1.md} +70 -33
- data/docs/{international_id_v2.md → global_products/international_id_v2.md} +39 -13
- data/docs/{invoice_splitter_v1.md → global_products/invoice_splitter_v1.md} +25 -6
- data/docs/{invoices_v4.md → global_products/invoices_v4.md} +70 -33
- data/docs/{multi_receipts_detector_v1.md → global_products/multi_receipts_detector_v1.md} +32 -13
- data/docs/{nutrition_facts_v1.md → global_products/nutrition_facts_v1.md} +103 -78
- data/docs/{passport_v1.md → global_products/passport_v1.md} +26 -9
- data/docs/{resume_v1.md → global_products/resume_v1.md} +72 -46
- data/docs/{generated_v1.md → global_products/universal.md} +39 -19
- data/docs/global_products.md +6 -0
- data/docs/loading_a_document.md +316 -0
- data/docs/{bank_account_details_v2.md → localized_products/bank_account_details_v2.md} +24 -7
- data/docs/{bank_check_v1.md → localized_products/bank_check_v1.md} +37 -18
- data/docs/localized_products/bank_statement_fr_v2.md +269 -0
- data/docs/{carte_grise_v1.md → localized_products/carte_grise_v1.md} +25 -8
- data/docs/{energy_bill_fra_v1.md → localized_products/energy_bill_fra_v1.md} +70 -45
- data/docs/{french_healthcard_v1.md → localized_products/french_healthcard_v1.md} +36 -11
- data/docs/{idcard_fr_v2.md → localized_products/idcard_fr_v2.md} +34 -16
- data/docs/{ind_passport_v1.md → localized_products/ind_passport_v1.md} +37 -11
- data/docs/{license_plates_v1.md → localized_products/license_plates_v1.md} +25 -8
- data/docs/{payslip_fra_v3.md → localized_products/payslip_fra_v3.md} +80 -55
- data/docs/{us_healthcare_cards_v1.md → localized_products/us_healthcare_cards_v1.md} +37 -12
- data/docs/{us_mail_v3.md → localized_products/us_mail_v3.md} +49 -24
- data/docs/{us_w9_v1.md → localized_products/us_w9_v1.md} +64 -45
- data/docs/localized_products.md +6 -0
- data/examples/auto_invoice_splitter_extraction.rb +5 -5
- data/examples/auto_multi_receipts_detector_extraction.rb +4 -5
- data/lib/mindee/client.rb +354 -209
- data/lib/mindee/errors/mindee_error.rb +17 -0
- data/lib/mindee/errors/mindee_http_error.rb +36 -0
- data/lib/mindee/errors/mindee_input_error.rb +30 -0
- data/lib/mindee/errors.rb +5 -0
- data/lib/mindee/extraction/multi_receipts_extractor.rb +28 -1
- data/lib/mindee/extraction.rb +0 -3
- data/lib/mindee/geometry/polygon.rb +1 -1
- data/lib/mindee/geometry/utils.rb +1 -1
- data/lib/mindee/http/endpoint.rb +48 -40
- data/lib/mindee/http/{error.rb → http_error_handler.rb} +5 -35
- data/lib/mindee/http/response_validation.rb +2 -2
- data/lib/mindee/http/workflow_endpoint.rb +12 -12
- data/lib/mindee/http.rb +1 -1
- data/lib/mindee/{extraction/common → image}/extracted_image.rb +22 -18
- data/lib/mindee/{extraction/common → image}/image_extractor.rb +20 -78
- data/lib/mindee/image/image_utils.rb +68 -7
- data/lib/mindee/image.rb +2 -0
- data/lib/mindee/input/local_response.rb +8 -8
- data/lib/mindee/input/sources/base64_input_source.rb +6 -6
- data/lib/mindee/input/sources/bytes_input_source.rb +3 -3
- data/lib/mindee/input/sources/file_input_source.rb +3 -3
- data/lib/mindee/input/sources/local_input_source.rb +43 -41
- data/lib/mindee/input/sources/path_input_source.rb +3 -3
- data/lib/mindee/input/sources/url_input_source.rb +11 -8
- data/lib/mindee/logging/logger.rb +16 -0
- data/lib/mindee/logging.rb +3 -0
- data/lib/mindee/parsing/common/api_request.rb +36 -0
- data/lib/mindee/parsing/common/api_response.rb +6 -96
- data/lib/mindee/parsing/common/document.rb +12 -8
- data/lib/mindee/parsing/common/execution.rb +4 -2
- data/lib/mindee/parsing/common/execution_priority.rb +6 -0
- data/lib/mindee/parsing/common/extras/cropper_extra.rb +2 -1
- data/lib/mindee/parsing/common/extras/extras.rb +9 -4
- data/lib/mindee/parsing/common/extras/full_text_ocr_extra.rb +1 -0
- data/lib/mindee/parsing/common/inference.rb +23 -4
- data/lib/mindee/parsing/common/job.rb +46 -0
- data/lib/mindee/parsing/common/ocr/mvision_v1.rb +6 -6
- data/lib/mindee/parsing/common/ocr/ocr.rb +29 -29
- data/lib/mindee/parsing/common/page.rb +5 -3
- data/lib/mindee/parsing/common/prediction.rb +2 -0
- data/lib/mindee/parsing/common/workflow_response.rb +28 -0
- data/lib/mindee/parsing/common.rb +3 -0
- data/lib/mindee/parsing/standard/abstract_field.rb +72 -0
- data/lib/mindee/parsing/standard/amount_field.rb +2 -2
- data/lib/mindee/parsing/standard/base_field.rb +5 -84
- data/lib/mindee/parsing/standard/boolean_field.rb +4 -3
- data/lib/mindee/parsing/standard/classification_field.rb +1 -1
- data/lib/mindee/parsing/standard/company_registration_field.rb +7 -2
- data/lib/mindee/parsing/standard/date_field.rb +2 -2
- data/lib/mindee/parsing/standard/feature_field.rb +24 -0
- data/lib/mindee/parsing/standard/payment_details_field.rb +2 -2
- data/lib/mindee/parsing/standard/position_field.rb +3 -1
- data/lib/mindee/parsing/standard/string_field.rb +1 -1
- data/lib/mindee/parsing/standard/tax_field.rb +1 -1
- data/lib/mindee/parsing/standard.rb +1 -0
- data/lib/mindee/parsing/{generated/generated_list_field.rb → universal/universal_list_field.rb} +12 -12
- data/lib/mindee/parsing/{generated/generated_object_field.rb → universal/universal_object_field.rb} +23 -14
- data/lib/mindee/parsing/universal.rb +4 -0
- data/lib/mindee/parsing.rb +1 -2
- data/lib/mindee/{extraction/pdf_extractor → pdf}/extracted_pdf.rb +15 -12
- data/lib/mindee/pdf/pdf_compressor.rb +12 -10
- data/lib/mindee/{extraction/pdf_extractor → pdf}/pdf_extractor.rb +20 -17
- data/lib/mindee/pdf/pdf_processor.rb +12 -22
- data/lib/mindee/pdf/pdf_tools.rb +52 -6
- data/lib/mindee/pdf.rb +2 -0
- data/lib/mindee/product/.rubocop.yml +3 -0
- data/lib/mindee/product/barcode_reader/barcode_reader_v1.rb +9 -3
- data/lib/mindee/product/barcode_reader/barcode_reader_v1_document.rb +5 -5
- data/lib/mindee/product/barcode_reader/barcode_reader_v1_page.rb +9 -5
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1.rb +9 -3
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb +1 -1
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_item.rb +13 -7
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rb +62 -0
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb +1 -1
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_document.rb +44 -17
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_notify_party.rb +1 -1
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_page.rb +9 -5
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_shipper.rb +1 -1
- data/lib/mindee/product/business_card/business_card_v1.rb +9 -3
- data/lib/mindee/product/business_card/business_card_v1_document.rb +40 -13
- data/lib/mindee/product/business_card/business_card_v1_page.rb +9 -5
- data/lib/mindee/product/cropper/cropper_v1.rb +10 -4
- data/lib/mindee/product/cropper/cropper_v1_page.rb +11 -7
- data/lib/mindee/product/delivery_note/delivery_note_v1.rb +9 -3
- data/lib/mindee/product/delivery_note/delivery_note_v1_document.rb +29 -8
- data/lib/mindee/product/delivery_note/delivery_note_v1_page.rb +9 -5
- data/lib/mindee/product/driver_license/driver_license_v1.rb +9 -3
- data/lib/mindee/product/driver_license/driver_license_v1_document.rb +44 -14
- data/lib/mindee/product/driver_license/driver_license_v1_page.rb +9 -5
- data/lib/mindee/product/eu/license_plate/license_plate_v1.rb +9 -3
- data/lib/mindee/product/eu/license_plate/license_plate_v1_document.rb +3 -3
- data/lib/mindee/product/eu/license_plate/license_plate_v1_page.rb +9 -5
- data/lib/mindee/product/financial_document/financial_document_v1.rb +9 -3
- data/lib/mindee/product/financial_document/financial_document_v1_document.rb +110 -42
- data/lib/mindee/product/financial_document/financial_document_v1_line_item.rb +21 -11
- data/lib/mindee/product/financial_document/financial_document_v1_line_items.rb +62 -0
- data/lib/mindee/product/financial_document/financial_document_v1_page.rb +9 -5
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1.rb +9 -3
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1_document.rb +7 -4
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1_page.rb +9 -5
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2.rb +9 -3
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_bban.rb +1 -1
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rb +11 -5
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_page.rb +9 -5
- data/lib/mindee/product/fr/bank_statement/bank_statement_v2.rb +47 -0
- data/lib/mindee/product/fr/bank_statement/{bank_statement_v1_document.rb → bank_statement_v2_document.rb} +62 -26
- data/lib/mindee/product/fr/bank_statement/bank_statement_v2_page.rb +38 -0
- data/lib/mindee/product/fr/bank_statement/{bank_statement_v1_transaction.rb → bank_statement_v2_transaction.rb} +17 -6
- data/lib/mindee/product/fr/bank_statement/bank_statement_v2_transactions.rb +54 -0
- data/lib/mindee/product/fr/carte_grise/carte_grise_v1.rb +9 -3
- data/lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb +51 -42
- data/lib/mindee/product/fr/carte_grise/carte_grise_v1_page.rb +9 -5
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1.rb +9 -3
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_document.rb +56 -30
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb +1 -1
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.rb +1 -1
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rb +13 -7
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rb +65 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb +1 -1
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_page.rb +9 -5
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_subscription.rb +13 -7
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_subscriptions.rb +65 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rb +13 -7
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rb +65 -0
- data/lib/mindee/product/fr/health_card/health_card_v1.rb +9 -3
- data/lib/mindee/product/fr/health_card/health_card_v1_document.rb +15 -6
- data/lib/mindee/product/fr/health_card/health_card_v1_page.rb +9 -5
- data/lib/mindee/product/fr/id_card/id_card_v1.rb +9 -3
- data/lib/mindee/product/fr/id_card/id_card_v1_document.rb +33 -12
- data/lib/mindee/product/fr/id_card/id_card_v1_page.rb +14 -7
- data/lib/mindee/product/fr/id_card/id_card_v2.rb +9 -3
- data/lib/mindee/product/fr/id_card/id_card_v2_document.rb +50 -17
- data/lib/mindee/product/fr/id_card/id_card_v2_page.rb +18 -8
- data/lib/mindee/product/fr/payslip/payslip_v2.rb +9 -3
- data/lib/mindee/product/fr/payslip/payslip_v2_bank_account_detail.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v2_document.rb +29 -14
- data/lib/mindee/product/fr/payslip/payslip_v2_employee.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v2_employer.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v2_employment.rb +3 -2
- data/lib/mindee/product/fr/payslip/payslip_v2_page.rb +9 -5
- data/lib/mindee/product/fr/payslip/payslip_v2_pay_detail.rb +33 -11
- data/lib/mindee/product/fr/payslip/payslip_v2_pay_period.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v2_pto.rb +13 -4
- data/lib/mindee/product/fr/payslip/payslip_v2_salary_detail.rb +13 -7
- data/lib/mindee/product/fr/payslip/payslip_v2_salary_details.rb +63 -0
- data/lib/mindee/product/fr/payslip/payslip_v3.rb +9 -3
- data/lib/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v3_document.rb +31 -19
- data/lib/mindee/product/fr/payslip/payslip_v3_employee.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v3_employer.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v3_employment.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v3_page.rb +9 -5
- data/lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb +13 -7
- data/lib/mindee/product/fr/payslip/payslip_v3_paid_time_offs.rb +65 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_pay_detail.rb +33 -11
- data/lib/mindee/product/fr/payslip/payslip_v3_pay_period.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v3_salary_detail.rb +17 -9
- data/lib/mindee/product/fr/payslip/payslip_v3_salary_details.rb +65 -0
- data/lib/mindee/product/ind/indian_passport/indian_passport_v1.rb +9 -3
- data/lib/mindee/product/ind/indian_passport/indian_passport_v1_document.rb +87 -24
- data/lib/mindee/product/ind/indian_passport/indian_passport_v1_page.rb +9 -5
- data/lib/mindee/product/international_id/international_id_v2.rb +9 -3
- data/lib/mindee/product/international_id/international_id_v2_document.rb +62 -20
- data/lib/mindee/product/international_id/international_id_v2_page.rb +9 -5
- data/lib/mindee/product/invoice/invoice_v4.rb +9 -3
- data/lib/mindee/product/invoice/invoice_v4_document.rb +90 -36
- data/lib/mindee/product/invoice/invoice_v4_line_item.rb +21 -11
- data/lib/mindee/product/invoice/invoice_v4_line_items.rb +62 -0
- data/lib/mindee/product/invoice/invoice_v4_page.rb +9 -5
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1.rb +8 -0
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb +2 -2
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_page.rb +1 -1
- data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.rb +9 -3
- data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_document.rb +3 -3
- data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_page.rb +9 -5
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1.rb +9 -3
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_document.rb +58 -20
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rb +13 -7
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rb +68 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_page.rb +9 -5
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rb +3 -2
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rb +7 -4
- data/lib/mindee/product/passport/passport_v1.rb +9 -3
- data/lib/mindee/product/passport/passport_v1_document.rb +37 -13
- data/lib/mindee/product/passport/passport_v1_page.rb +9 -5
- data/lib/mindee/product/receipt/receipt_v5.rb +9 -3
- data/lib/mindee/product/receipt/receipt_v5_document.rb +54 -24
- data/lib/mindee/product/receipt/receipt_v5_line_item.rb +13 -7
- data/lib/mindee/product/receipt/receipt_v5_line_items.rb +54 -0
- data/lib/mindee/product/receipt/receipt_v5_page.rb +9 -5
- data/lib/mindee/product/resume/resume_v1.rb +9 -3
- data/lib/mindee/product/resume/resume_v1_certificate.rb +1 -1
- data/lib/mindee/product/resume/resume_v1_certificates.rb +58 -0
- data/lib/mindee/product/resume/resume_v1_document.rb +60 -47
- data/lib/mindee/product/resume/resume_v1_education.rb +1 -1
- data/lib/mindee/product/resume/resume_v1_educations.rb +64 -0
- data/lib/mindee/product/resume/resume_v1_language.rb +1 -1
- data/lib/mindee/product/resume/resume_v1_languages.rb +54 -0
- data/lib/mindee/product/resume/resume_v1_page.rb +9 -5
- data/lib/mindee/product/resume/resume_v1_professional_experience.rb +1 -1
- data/lib/mindee/product/resume/resume_v1_professional_experiences.rb +68 -0
- data/lib/mindee/product/resume/resume_v1_social_networks_url.rb +1 -1
- data/lib/mindee/product/resume/resume_v1_social_networks_urls.rb +54 -0
- data/lib/mindee/product/universal/universal.rb +46 -0
- data/lib/mindee/product/universal/universal_document.rb +32 -0
- data/lib/mindee/product/{generated/generated_v1_page.rb → universal/universal_page.rb} +14 -14
- data/lib/mindee/product/{generated/generated_v1_prediction.rb → universal/universal_prediction.rb} +32 -24
- data/lib/mindee/product/us/bank_check/bank_check_v1.rb +9 -3
- data/lib/mindee/product/us/bank_check/bank_check_v1_document.rb +20 -8
- data/lib/mindee/product/us/bank_check/bank_check_v1_page.rb +15 -8
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1.rb +9 -3
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb +5 -3
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb +52 -0
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb +46 -19
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb +9 -5
- data/lib/mindee/product/us/us_mail/us_mail_v3.rb +9 -3
- data/lib/mindee/product/us/us_mail/us_mail_v3_document.rb +20 -12
- data/lib/mindee/product/us/us_mail/us_mail_v3_page.rb +9 -5
- data/lib/mindee/product/us/us_mail/us_mail_v3_recipient_address.rb +2 -2
- data/lib/mindee/product/us/us_mail/us_mail_v3_recipient_addresses.rb +65 -0
- data/lib/mindee/product/us/us_mail/us_mail_v3_sender_address.rb +1 -1
- data/lib/mindee/product/us/w9/w9_v1.rb +10 -4
- data/lib/mindee/product/us/w9/w9_v1_page.rb +49 -18
- data/lib/mindee/product.rb +2 -8
- data/lib/mindee/version.rb +2 -2
- data/lib/mindee.rb +22 -9
- data/mindee.gemspec +19 -17
- data/sig/custom/marcel.rbs +3 -0
- data/sig/custom/mini_magick.rbs +24 -0
- data/sig/custom/net_http.rbs +34 -0
- data/sig/custom/origami.rbs +54 -0
- data/sig/mindee/client.rbs +63 -0
- data/sig/mindee/errors/mindee_error.rbs +13 -0
- data/sig/mindee/errors/mindee_http_error.rbs +16 -0
- data/sig/mindee/errors/mindee_input_error.rbs +17 -0
- data/sig/mindee/extraction/multi_receipts_extractor.rbs +6 -0
- data/sig/mindee/geometry/min_max.rbs +10 -0
- data/sig/mindee/geometry/point.rbs +13 -0
- data/sig/mindee/geometry/polygon.rbs +9 -0
- data/sig/mindee/geometry/quadrilateral.rbs +18 -0
- data/sig/mindee/geometry/utils.rbs +13 -0
- data/sig/mindee/http/endpoint.rbs +26 -0
- data/sig/mindee/http/http_error_handler.rbs +10 -0
- data/sig/mindee/http/response_validation.rbs +10 -0
- data/sig/mindee/http/workflow_endpoint.rbs +14 -0
- data/sig/mindee/image/extracted_image.rbs +15 -0
- data/sig/mindee/image/image_compressor.rbs +8 -0
- data/sig/mindee/image/image_extractor.rbs +13 -0
- data/sig/mindee/image/image_utils.rbs +19 -0
- data/sig/mindee/input/local_response.rbs +13 -0
- data/sig/mindee/input/sources/base64_input_source.rbs +11 -0
- data/sig/mindee/input/sources/bytes_input_source.rbs +10 -0
- data/sig/mindee/input/sources/file_input_source.rbs +10 -0
- data/sig/mindee/input/sources/local_input_source.rbs +24 -0
- data/sig/mindee/input/sources/path_input_source.rbs +10 -0
- data/sig/mindee/input/sources/url_input_source.rbs +20 -0
- data/sig/mindee/logging/logger.rbs +9 -0
- data/sig/mindee/parsing/common/api_request.rbs +15 -0
- data/sig/mindee/parsing/common/api_response.rbs +27 -0
- data/sig/mindee/parsing/common/document.rbs +20 -0
- data/sig/mindee/parsing/common/execution.rbs +23 -0
- data/sig/mindee/parsing/common/execution_file.rbs +12 -0
- data/sig/mindee/parsing/common/execution_priority.rbs +13 -0
- data/sig/mindee/parsing/common/extras/cropper_extra.rbs +14 -0
- data/sig/mindee/parsing/common/extras/extras.rbs +18 -0
- data/sig/mindee/parsing/common/extras/full_text_ocr_extra.rbs +15 -0
- data/sig/mindee/parsing/common/inference.rbs +19 -0
- data/sig/mindee/parsing/common/job.rbs +16 -0
- data/sig/mindee/parsing/common/ocr/mvision_v1.rbs +15 -0
- data/sig/mindee/parsing/common/ocr/ocr.rbs +39 -0
- data/sig/mindee/parsing/common/orientation.rbs +12 -0
- data/sig/mindee/parsing/common/page.rbs +15 -0
- data/sig/mindee/parsing/common/prediction.rbs +11 -0
- data/sig/mindee/parsing/common/product.rbs +13 -0
- data/sig/mindee/parsing/common/workflow_response.rbs +13 -0
- data/sig/mindee/parsing/standard/abstract_field.rbs +19 -0
- data/sig/mindee/parsing/standard/amount_field.rbs +12 -0
- data/sig/mindee/parsing/standard/base_field.rbs +12 -0
- data/sig/mindee/parsing/standard/boolean_field.rbs +12 -0
- data/sig/mindee/parsing/standard/classification_field.rbs +10 -0
- data/sig/mindee/parsing/standard/company_registration_field.rbs +14 -0
- data/sig/mindee/parsing/standard/date_field.rbs +14 -0
- data/sig/mindee/parsing/standard/feature_field.rbs +10 -0
- data/sig/mindee/parsing/standard/locale_field.rbs +16 -0
- data/sig/mindee/parsing/standard/payment_details_field.rbs +15 -0
- data/sig/mindee/parsing/standard/position_field.rbs +17 -0
- data/sig/mindee/parsing/standard/string_field.rbs +12 -0
- data/sig/mindee/parsing/standard/tax_field.rbs +23 -0
- data/sig/mindee/parsing/universal/universal_list_field.rbs +17 -0
- data/sig/mindee/parsing/universal/universal_object_field.rbs +23 -0
- data/sig/mindee/pdf/extracted_pdf.rbs +15 -0
- data/sig/mindee/pdf/pdf_compressor.rbs +15 -0
- data/sig/mindee/pdf/pdf_extractor.rbs +16 -0
- data/sig/mindee/pdf/pdf_processor.rbs +12 -0
- data/sig/mindee/pdf/pdf_tools.rbs +23 -0
- data/sig/mindee/product/barcode_reader/barcode_reader_v1.rbs +11 -0
- data/sig/mindee/product/barcode_reader/barcode_reader_v1_document.rbs +14 -0
- data/sig/mindee/product/barcode_reader/barcode_reader_v1_page.rbs +15 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1.rbs +11 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rbs +14 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_item.rbs +19 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rbs +13 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rbs +15 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_document.rbs +25 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_notify_party.rbs +15 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_page.rbs +15 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_shipper.rbs +15 -0
- data/sig/mindee/product/business_card/business_card_v1.rbs +11 -0
- data/sig/mindee/product/business_card/business_card_v1_document.rbs +23 -0
- data/sig/mindee/product/business_card/business_card_v1_page.rbs +15 -0
- data/sig/mindee/product/cropper/cropper_v1.rbs +11 -0
- data/sig/mindee/product/cropper/cropper_v1_document.rbs +12 -0
- data/sig/mindee/product/cropper/cropper_v1_page.rbs +16 -0
- data/sig/mindee/product/delivery_note/delivery_note_v1.rbs +11 -0
- data/sig/mindee/product/delivery_note/delivery_note_v1_document.rbs +19 -0
- data/sig/mindee/product/delivery_note/delivery_note_v1_page.rbs +15 -0
- data/sig/mindee/product/driver_license/driver_license_v1.rbs +11 -0
- data/sig/mindee/product/driver_license/driver_license_v1_document.rbs +25 -0
- data/sig/mindee/product/driver_license/driver_license_v1_page.rbs +15 -0
- data/sig/mindee/product/eu/license_plate/license_plate_v1.rbs +13 -0
- data/sig/mindee/product/eu/license_plate/license_plate_v1_document.rbs +15 -0
- data/sig/mindee/product/eu/license_plate/license_plate_v1_page.rbs +17 -0
- data/sig/mindee/product/financial_document/financial_document_v1.rbs +11 -0
- data/sig/mindee/product/financial_document/financial_document_v1_document.rbs +46 -0
- data/sig/mindee/product/financial_document/financial_document_v1_line_item.rbs +21 -0
- data/sig/mindee/product/financial_document/financial_document_v1_line_items.rbs +13 -0
- data/sig/mindee/product/financial_document/financial_document_v1_page.rbs +15 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v1.rbs +13 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v1_document.rbs +17 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v1_page.rbs +17 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2.rbs +13 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2_bban.rbs +17 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rbs +18 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2_page.rbs +17 -0
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2.rbs +13 -0
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2_document.rbs +29 -0
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2_page.rbs +17 -0
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2_transaction.rbs +18 -0
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2_transactions.rbs +15 -0
- data/sig/mindee/product/fr/carte_grise/carte_grise_v1.rbs +13 -0
- data/sig/mindee/product/fr/carte_grise/carte_grise_v1_document.rbs +55 -0
- data/sig/mindee/product/fr/carte_grise/carte_grise_v1_page.rbs +17 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1.rbs +13 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_document.rbs +34 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rbs +15 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.rbs +15 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rbs +21 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rbs +15 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rbs +16 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_page.rbs +17 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_subscription.rbs +21 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_subscriptions.rbs +15 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rbs +21 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rbs +15 -0
- data/sig/mindee/product/fr/health_card/health_card_v1.rbs +13 -0
- data/sig/mindee/product/fr/health_card/health_card_v1_document.rbs +18 -0
- data/sig/mindee/product/fr/health_card/health_card_v1_page.rbs +17 -0
- data/sig/mindee/product/fr/id_card/id_card_v1.rbs +13 -0
- data/sig/mindee/product/fr/id_card/id_card_v1_document.rbs +24 -0
- data/sig/mindee/product/fr/id_card/id_card_v1_page.rbs +18 -0
- data/sig/mindee/product/fr/id_card/id_card_v2.rbs +13 -0
- data/sig/mindee/product/fr/id_card/id_card_v2_document.rbs +29 -0
- data/sig/mindee/product/fr/id_card/id_card_v2_page.rbs +19 -0
- data/sig/mindee/product/fr/payslip/payslip_v2.rbs +13 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_bank_account_detail.rbs +16 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_document.rbs +24 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_employee.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_employer.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_employment.rbs +19 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_page.rbs +17 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_pay_detail.rbs +23 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_pay_period.rbs +18 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_pto.rbs +16 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_salary_detail.rbs +19 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_salary_details.rbs +15 -0
- data/sig/mindee/product/fr/payslip/payslip_v3.rbs +13 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rbs +16 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_document.rbs +26 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_employee.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_employer.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_employment.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_page.rbs +17 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_paid_time_off.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_paid_time_offs.rbs +15 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_pay_detail.rbs +23 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_pay_period.rbs +18 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_salary_detail.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_salary_details.rbs +15 -0
- data/sig/mindee/product/ind/indian_passport/indian_passport_v1.rbs +13 -0
- data/sig/mindee/product/ind/indian_passport/indian_passport_v1_document.rbs +37 -0
- data/sig/mindee/product/ind/indian_passport/indian_passport_v1_page.rbs +17 -0
- data/sig/mindee/product/international_id/international_id_v2.rbs +11 -0
- data/sig/mindee/product/international_id/international_id_v2_document.rbs +29 -0
- data/sig/mindee/product/international_id/international_id_v2_page.rbs +15 -0
- data/sig/mindee/product/invoice/invoice_v4.rbs +11 -0
- data/sig/mindee/product/invoice/invoice_v4_document.rbs +40 -0
- data/sig/mindee/product/invoice/invoice_v4_line_item.rbs +21 -0
- data/sig/mindee/product/invoice/invoice_v4_line_items.rbs +13 -0
- data/sig/mindee/product/invoice/invoice_v4_page.rbs +15 -0
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1.rbs +14 -0
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_document.rbs +19 -0
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_page.rbs +13 -0
- data/sig/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.rbs +11 -0
- data/sig/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_document.rbs +13 -0
- data/sig/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_page.rbs +15 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1.rbs +11 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_document.rbs +28 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rbs +18 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rbs +13 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_page.rbs +15 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rbs +13 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rbs +15 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rbs +14 -0
- data/sig/mindee/product/passport/passport_v1.rbs +11 -0
- data/sig/mindee/product/passport/passport_v1_document.rbs +23 -0
- data/sig/mindee/product/passport/passport_v1_page.rbs +15 -0
- data/sig/mindee/product/receipt/receipt_v5.rbs +11 -0
- data/sig/mindee/product/receipt/receipt_v5_document.rbs +31 -0
- data/sig/mindee/product/receipt/receipt_v5_line_item.rbs +17 -0
- data/sig/mindee/product/receipt/receipt_v5_line_items.rbs +13 -0
- data/sig/mindee/product/receipt/receipt_v5_page.rbs +15 -0
- data/sig/mindee/product/resume/resume_v1.rbs +11 -0
- data/sig/mindee/product/resume/resume_v1_certificate.rbs +17 -0
- data/sig/mindee/product/resume/resume_v1_certificates.rbs +13 -0
- data/sig/mindee/product/resume/resume_v1_document.rbs +39 -0
- data/sig/mindee/product/resume/resume_v1_education.rbs +20 -0
- data/sig/mindee/product/resume/resume_v1_educations.rbs +13 -0
- data/sig/mindee/product/resume/resume_v1_language.rbs +15 -0
- data/sig/mindee/product/resume/resume_v1_languages.rbs +13 -0
- data/sig/mindee/product/resume/resume_v1_page.rbs +15 -0
- data/sig/mindee/product/resume/resume_v1_professional_experience.rbs +22 -0
- data/sig/mindee/product/resume/resume_v1_professional_experiences.rbs +13 -0
- data/sig/mindee/product/resume/resume_v1_social_networks_url.rbs +15 -0
- data/sig/mindee/product/resume/resume_v1_social_networks_urls.rbs +13 -0
- data/sig/mindee/product/universal/universal.rbs +14 -0
- data/sig/mindee/product/universal/universal_document.rbs +10 -0
- data/sig/mindee/product/universal/universal_page.rbs +14 -0
- data/sig/mindee/product/universal/universal_prediction.rbs +19 -0
- data/sig/mindee/product/us/bank_check/bank_check_v1.rbs +13 -0
- data/sig/mindee/product/us/bank_check/bank_check_v1_document.rbs +20 -0
- data/sig/mindee/product/us/bank_check/bank_check_v1_page.rbs +19 -0
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1.rbs +13 -0
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rbs +17 -0
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rbs +15 -0
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_document.rbs +28 -0
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_page.rbs +17 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3.rbs +13 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_document.rbs +21 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_page.rbs +17 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_recipient_address.rbs +23 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_recipient_addresses.rbs +15 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_sender_address.rbs +18 -0
- data/sig/mindee/product/us/w9/w9_v1.rbs +13 -0
- data/sig/mindee/product/us/w9/w9_v1_document.rbs +14 -0
- data/sig/mindee/product/us/w9/w9_v1_page.rbs +29 -0
- data/sig/mindee/version.rbs +6 -0
- data/sig/mindee.rbs +59 -0
- metadata +395 -103
- data/docs/bank_statement_fr_v1.md +0 -178
- data/docs/code_samples/bank_statement_fr_v1_async.txt +0 -19
- data/docs/code_samples/custom_v1.txt +0 -33
- data/docs/code_samples/eu_driver_license_v1.txt +0 -19
- data/docs/code_samples/expense_receipts_v4.txt +0 -19
- data/docs/code_samples/proof_of_address_v1.txt +0 -19
- data/docs/code_samples/us_mail_v2_async.txt +0 -19
- data/docs/code_samples/workflow_execution.txt +0 -29
- data/docs/custom_v1.md +0 -111
- data/docs/payslip_fra_v2.md +0 -294
- data/lib/mindee/extraction/common.rb +0 -4
- data/lib/mindee/extraction/multi_receipts_extractor/multi_receipts_extractor.rb +0 -32
- data/lib/mindee/extraction/pdf_extractor.rb +0 -4
- data/lib/mindee/extraction/tax_extractor/ocr_extractor.rb +0 -110
- data/lib/mindee/extraction/tax_extractor/tax_extractor.rb +0 -338
- data/lib/mindee/extraction/tax_extractor.rb +0 -3
- data/lib/mindee/parsing/custom/classification_field.rb +0 -28
- data/lib/mindee/parsing/custom/list_field.rb +0 -78
- data/lib/mindee/parsing/custom.rb +0 -4
- data/lib/mindee/parsing/generated.rb +0 -4
- data/lib/mindee/product/custom/custom_v1.rb +0 -36
- data/lib/mindee/product/custom/custom_v1_document.rb +0 -60
- data/lib/mindee/product/custom/custom_v1_page.rb +0 -32
- data/lib/mindee/product/eu/driver_license/driver_license_v1.rb +0 -41
- data/lib/mindee/product/eu/driver_license/driver_license_v1_document.rb +0 -88
- data/lib/mindee/product/eu/driver_license/driver_license_v1_page.rb +0 -53
- data/lib/mindee/product/fr/bank_statement/bank_statement_v1.rb +0 -41
- data/lib/mindee/product/fr/bank_statement/bank_statement_v1_page.rb +0 -34
- data/lib/mindee/product/generated/generated_v1.rb +0 -38
- data/lib/mindee/product/generated/generated_v1_document.rb +0 -35
- data/lib/mindee/product/proof_of_address/proof_of_address_v1.rb +0 -39
- data/lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb +0 -83
- data/lib/mindee/product/proof_of_address/proof_of_address_v1_page.rb +0 -32
- data/lib/mindee/product/receipt/receipt_v4.rb +0 -36
- data/lib/mindee/product/receipt/receipt_v4_document.rb +0 -86
- data/lib/mindee/product/receipt/receipt_v4_page.rb +0 -32
- data/lib/mindee/product/us/driver_license/driver_license_v1.rb +0 -41
- data/lib/mindee/product/us/driver_license/driver_license_v1_document.rb +0 -113
- data/lib/mindee/product/us/driver_license/driver_license_v1_page.rb +0 -53
- data/lib/mindee/product/us/us_mail/us_mail_v2.rb +0 -41
- data/lib/mindee/product/us/us_mail/us_mail_v2_document.rb +0 -100
- data/lib/mindee/product/us/us_mail/us_mail_v2_page.rb +0 -34
- data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_address.rb +0 -105
- data/lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb +0 -66
@@ -1,16 +1,42 @@
|
|
1
1
|
---
|
2
|
-
title: Financial Document
|
2
|
+
title: Ruby Client Library - Financial Document
|
3
3
|
category: 622b805aaec68102ea7fcbc2
|
4
4
|
slug: ruby-financial-document-ocr
|
5
|
-
parentDoc:
|
5
|
+
parentDoc: 67b49df15b843f3fa9cd622b
|
6
6
|
---
|
7
|
-
The Ruby
|
8
|
-
|
9
|
-
|
7
|
+
The Ruby Client Library supports the [Financial Document API](https://platform.mindee.com/mindee/financial_document).
|
8
|
+
|
9
|
+
|
10
|
+
> 📝 Product Specs
|
11
|
+
>
|
12
|
+
> | Specification | Details |
|
13
|
+
> | ------------------------------ | -------------------------------------------------- |
|
14
|
+
> | Endpoint Name | `financial_document` |
|
15
|
+
> | Recommended Version | `v1.11` |
|
16
|
+
> | Supports Polling/Webhooks | ✔️ Yes |
|
17
|
+
> | Support Synchronous HTTP Calls | ✔️ Yes |
|
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/financial_document/default_sample.jpg),
|
30
|
+
we are going to illustrate how to extract the data that we want using the Ruby Client Library.
|
10
31
|

|
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
|
@@ -22,7 +48,8 @@ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
|
22
48
|
# Parse the file
|
23
49
|
result = mindee_client.parse(
|
24
50
|
input_source,
|
25
|
-
Mindee::Product::FinancialDocument::FinancialDocumentV1
|
51
|
+
Mindee::Product::FinancialDocument::FinancialDocumentV1,
|
52
|
+
enqueue: false
|
26
53
|
)
|
27
54
|
|
28
55
|
# Print a full summary of the parsed data in RST format
|
@@ -30,12 +57,16 @@ puts result.document
|
|
30
57
|
|
31
58
|
# Print the document-level parsed data
|
32
59
|
# puts result.document.inference.prediction
|
33
|
-
|
34
60
|
```
|
35
61
|
|
36
62
|
You can also call this product asynchronously:
|
37
63
|
|
38
64
|
```rb
|
65
|
+
#
|
66
|
+
# Install the Ruby client library by running:
|
67
|
+
# gem install mindee
|
68
|
+
#
|
69
|
+
|
39
70
|
require 'mindee'
|
40
71
|
|
41
72
|
# Init a new client
|
@@ -45,7 +76,7 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
|
45
76
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
46
77
|
|
47
78
|
# Parse the file
|
48
|
-
result = mindee_client.
|
79
|
+
result = mindee_client.parse(
|
49
80
|
input_source,
|
50
81
|
Mindee::Product::FinancialDocument::FinancialDocumentV1
|
51
82
|
)
|
@@ -55,7 +86,6 @@ puts result.document
|
|
55
86
|
|
56
87
|
# Print the document-level parsed data
|
57
88
|
# puts result.document.inference.prediction
|
58
|
-
|
59
89
|
```
|
60
90
|
|
61
91
|
**Output (RST):**
|
@@ -63,7 +93,7 @@ puts result.document
|
|
63
93
|
########
|
64
94
|
Document
|
65
95
|
########
|
66
|
-
:Mindee ID:
|
96
|
+
:Mindee ID: f469a24d-3875-4a83-ad43-e0d5aa9da604
|
67
97
|
:Filename: default_sample.jpg
|
68
98
|
|
69
99
|
Inference
|
@@ -80,8 +110,8 @@ Prediction
|
|
80
110
|
:Document Number: INT-001
|
81
111
|
:Reference Numbers: 2412/2019
|
82
112
|
:Purchase Date: 2019-11-02
|
83
|
-
:Due Date: 2019-
|
84
|
-
:Payment Date: 2019-
|
113
|
+
:Due Date: 2019-11-17
|
114
|
+
:Payment Date: 2019-11-17
|
85
115
|
:Total Net: 195.00
|
86
116
|
:Total Amount: 204.75
|
87
117
|
:Taxes:
|
@@ -132,8 +162,8 @@ Page 0
|
|
132
162
|
:Document Number: INT-001
|
133
163
|
:Reference Numbers: 2412/2019
|
134
164
|
:Purchase Date: 2019-11-02
|
135
|
-
:Due Date: 2019-
|
136
|
-
:Payment Date: 2019-
|
165
|
+
:Due Date: 2019-11-17
|
166
|
+
:Payment Date: 2019-11-17
|
137
167
|
:Total Net: 195.00
|
138
168
|
:Total Amount: 204.75
|
139
169
|
:Taxes:
|
@@ -181,12 +211,12 @@ These fields are generic and used in several products.
|
|
181
211
|
Each prediction object contains a set of fields that inherit from the generic `Field` class.
|
182
212
|
A typical `Field` object will have the following attributes:
|
183
213
|
|
184
|
-
* **value** (`String`, `Float`, `Integer`, `
|
214
|
+
* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted.
|
185
215
|
* **confidence** (Float, nil): the confidence score of the field prediction.
|
186
216
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
187
217
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
188
218
|
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
189
|
-
* **reconstructed** (`
|
219
|
+
* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
190
220
|
|
191
221
|
|
192
222
|
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.
|
@@ -197,30 +227,35 @@ The amount field `AmountField` only has one constraint: its **value** is a `Floa
|
|
197
227
|
|
198
228
|
|
199
229
|
### Classification Field
|
200
|
-
The classification field `ClassificationField` does not implement all the basic `Field` attributes. It only implements
|
230
|
+
The classification field `ClassificationField` does not implement all the basic `Field` attributes. It only implements
|
231
|
+
**value**, **confidence** and **page_id**.
|
201
232
|
|
202
233
|
> Note: a classification field's `value is always a `String`.
|
203
234
|
|
204
235
|
|
205
236
|
### Company Registration Field
|
206
|
-
Aside from the basic `Field` attributes, the company registration field `CompanyRegistrationField` also implements the
|
237
|
+
Aside from the basic `Field` attributes, the company registration field `CompanyRegistrationField` also implements the
|
238
|
+
following:
|
207
239
|
|
208
240
|
* **type** (`String`): the type of company.
|
209
241
|
|
210
242
|
### Date Field
|
211
|
-
Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
|
243
|
+
Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
|
212
244
|
|
213
245
|
* **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
|
214
246
|
|
215
247
|
### Locale Field
|
216
|
-
The locale field `LocaleField` only implements the **value**, **confidence** and **page_id** base `Field` attributes,
|
248
|
+
The locale field `LocaleField` only implements the **value**, **confidence** and **page_id** base `Field` attributes,
|
249
|
+
but it comes with its own:
|
217
250
|
|
218
251
|
* **language** (`String`): ISO 639-1 language code (e.g.: `en` for English). Can be `nil`.
|
219
|
-
* **country** (`String`): ISO 3166-1 alpha-2 or ISO 3166-1 alpha-3 code for countries (e.g.: `GRB` or `GB` for "Great
|
252
|
+
* **country** (`String`): ISO 3166-1 alpha-2 or ISO 3166-1 alpha-3 code for countries (e.g.: `GRB` or `GB` for "Great
|
253
|
+
Britain"). Can be `nil`.
|
220
254
|
* **currency** (`String`): ISO 4217 code for currencies (e.g.: `USD` for "US Dollars"). Can be `nil`.
|
221
255
|
|
222
256
|
### Payment Details Field
|
223
|
-
Aside from the basic `Field` attributes, the payment details field `PaymentDetailsField` also implements the
|
257
|
+
Aside from the basic `Field` attributes, the payment details field `PaymentDetailsField` also implements the
|
258
|
+
following:
|
224
259
|
|
225
260
|
* **account_number** (`String`): number of an account, expressed as a string. Can be `nil`.
|
226
261
|
* **iban** (`String`): International Bank Account Number. Can be `nil`.
|
@@ -238,10 +273,12 @@ Aside from the basic `Field` attributes, the tax field `TaxField` also implement
|
|
238
273
|
* **code** (`String`): tax code (or equivalent, depending on the origin of the document). Can be `nil`.
|
239
274
|
* **base** (`Float`): base amount used for the tax. Can be `nil`.
|
240
275
|
|
241
|
-
> Note: currently `TaxField` is not used on its own, and is accessed through a parent `Taxes` object, an array-like
|
276
|
+
> Note: currently `TaxField` is not used on its own, and is accessed through a parent `Taxes` object, an array-like
|
277
|
+
structure.
|
242
278
|
|
243
279
|
#### Taxes (Array)
|
244
|
-
The `Taxes` field represents an array-like collection of `TaxField` objects. As it is the representation of several
|
280
|
+
The `Taxes` field represents an array-like collection of `TaxField` objects. As it is the representation of several
|
281
|
+
objects, it has access to a custom `to_s` method that can render a `TaxField` object as a table line.
|
245
282
|
|
246
283
|
## Specific Fields
|
247
284
|
Fields which are specific to this product; they are not used in any other product.
|
@@ -298,7 +335,7 @@ puts result.document.inference.prediction.customer_address.value
|
|
298
335
|
**customer_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registrations associated to the customer.
|
299
336
|
|
300
337
|
```rb
|
301
|
-
|
338
|
+
result.document.inference.prediction.customer_company_registrations do |customer_company_registrations_elem|
|
302
339
|
puts customer_company_registrations_elem.value
|
303
340
|
end
|
304
341
|
```
|
@@ -362,7 +399,7 @@ puts result.document.inference.prediction.invoice_number.value
|
|
362
399
|
**line_items** (Array<[FinancialDocumentV1LineItem](#line-items-field)>): List of line item details.
|
363
400
|
|
364
401
|
```rb
|
365
|
-
|
402
|
+
result.document.inference.prediction.line_items do |line_items_elem|
|
366
403
|
puts line_items_elem.value
|
367
404
|
end
|
368
405
|
```
|
@@ -399,7 +436,7 @@ puts result.document.inference.prediction.receipt_number.value
|
|
399
436
|
**reference_numbers** (Array<[StringField](#string-field)>): List of Reference numbers, including PO number.
|
400
437
|
|
401
438
|
```rb
|
402
|
-
|
439
|
+
result.document.inference.prediction.reference_numbers do |reference_numbers_elem|
|
403
440
|
puts reference_numbers_elem.value
|
404
441
|
end
|
405
442
|
```
|
@@ -436,7 +473,7 @@ puts result.document.inference.prediction.supplier_address.value
|
|
436
473
|
**supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registrations associated to the supplier.
|
437
474
|
|
438
475
|
```rb
|
439
|
-
|
476
|
+
result.document.inference.prediction.supplier_company_registrations do |supplier_company_registrations_elem|
|
440
477
|
puts supplier_company_registrations_elem.value
|
441
478
|
end
|
442
479
|
```
|
@@ -459,11 +496,11 @@ puts result.document.inference.prediction.supplier_name.value
|
|
459
496
|
**supplier_payment_details** (Array<[PaymentDetailsField](#payment-details-field)>): List of payment details associated to the supplier.
|
460
497
|
|
461
498
|
```rb
|
462
|
-
|
499
|
+
result.document.inference.prediction.supplier_payment_details do |supplier_payment_details_elem|
|
463
500
|
puts supplier_payment_details_elem.value
|
464
|
-
|
465
|
-
|
466
|
-
|
501
|
+
puts supplier_payment_details_elem.rate
|
502
|
+
puts supplier_payment_details_elem.code
|
503
|
+
puts supplier_payment_details_elem.basis
|
467
504
|
end
|
468
505
|
```
|
469
506
|
|
@@ -485,7 +522,7 @@ puts result.document.inference.prediction.supplier_website.value
|
|
485
522
|
**taxes** (Array<[TaxField](#taxes-field)>): List of tax lines information.
|
486
523
|
|
487
524
|
```rb
|
488
|
-
|
525
|
+
result.document.inference.prediction.taxes do |taxes_elem|
|
489
526
|
puts taxes_elem.value
|
490
527
|
end
|
491
528
|
```
|
@@ -1,16 +1,42 @@
|
|
1
1
|
---
|
2
|
-
title: International ID
|
2
|
+
title: Ruby Client Library - International ID
|
3
3
|
category: 622b805aaec68102ea7fcbc2
|
4
4
|
slug: ruby-international-id-ocr
|
5
|
-
parentDoc:
|
5
|
+
parentDoc: 67b49df15b843f3fa9cd622b
|
6
6
|
---
|
7
|
-
The Ruby
|
8
|
-
|
9
|
-
|
7
|
+
The Ruby Client Library supports the [International ID API](https://platform.mindee.com/mindee/international_id).
|
8
|
+
|
9
|
+
|
10
|
+
> 📝 Product Specs
|
11
|
+
>
|
12
|
+
> | Specification | Details |
|
13
|
+
> | ------------------------------ | -------------------------------------------------- |
|
14
|
+
> | Endpoint Name | `international_id` |
|
15
|
+
> | Recommended Version | `v2.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/international_id/default_sample.jpg),
|
30
|
+
we are going to illustrate how to extract the data that we want using the Ruby Client Library.
|
10
31
|

|
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.
|
49
|
+
result = mindee_client.parse(
|
24
50
|
input_source,
|
25
51
|
Mindee::Product::InternationalId::InternationalIdV2
|
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):**
|
@@ -76,24 +101,25 @@ These fields are generic and used in several products.
|
|
76
101
|
Each prediction object contains a set of fields that inherit from the generic `Field` class.
|
77
102
|
A typical `Field` object will have the following attributes:
|
78
103
|
|
79
|
-
* **value** (`String`, `Float`, `Integer`, `
|
104
|
+
* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted.
|
80
105
|
* **confidence** (Float, nil): the confidence score of the field prediction.
|
81
106
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
82
107
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
83
108
|
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
84
|
-
* **reconstructed** (`
|
109
|
+
* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
85
110
|
|
86
111
|
|
87
112
|
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
113
|
|
89
114
|
|
90
115
|
### Classification Field
|
91
|
-
The classification field `ClassificationField` does not implement all the basic `Field` attributes. It only implements
|
116
|
+
The classification field `ClassificationField` does not implement all the basic `Field` attributes. It only implements
|
117
|
+
**value**, **confidence** and **page_id**.
|
92
118
|
|
93
119
|
> Note: a classification field's `value is always a `String`.
|
94
120
|
|
95
121
|
### Date Field
|
96
|
-
Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
|
122
|
+
Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
|
97
123
|
|
98
124
|
* **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
|
99
125
|
|
@@ -164,7 +190,7 @@ puts result.document.inference.prediction.expiry_date.value
|
|
164
190
|
**given_names** (Array<[StringField](#string-field)>): The list of the document holder's given names.
|
165
191
|
|
166
192
|
```rb
|
167
|
-
|
193
|
+
result.document.inference.prediction.given_names do |given_names_elem|
|
168
194
|
puts given_names_elem.value
|
169
195
|
end
|
170
196
|
```
|
@@ -229,7 +255,7 @@ puts result.document.inference.prediction.state_of_issue.value
|
|
229
255
|
**surnames** (Array<[StringField](#string-field)>): The list of the document holder's family names.
|
230
256
|
|
231
257
|
```rb
|
232
|
-
|
258
|
+
result.document.inference.prediction.surnames do |surnames_elem|
|
233
259
|
puts surnames_elem.value
|
234
260
|
end
|
235
261
|
```
|
@@ -2,11 +2,30 @@
|
|
2
2
|
title: Invoice Splitter API Ruby
|
3
3
|
category: 622b805aaec68102ea7fcbc2
|
4
4
|
slug: ruby-invoice-splitter-ocr
|
5
|
-
parentDoc:
|
5
|
+
parentDoc: 67b49df15b843f3fa9cd622b
|
6
6
|
---
|
7
|
-
The Ruby
|
8
|
-
|
9
|
-
|
7
|
+
The Ruby Client Library supports the [Invoice Splitter API](https://platform.mindee.com/mindee/invoice_splitter).
|
8
|
+
|
9
|
+
> 📝 Product Specs
|
10
|
+
>
|
11
|
+
> | Specification | Details |
|
12
|
+
> | ------------------------------ |--------------------|
|
13
|
+
> | Endpoint Name | `invoice_splitter` |
|
14
|
+
> | Recommended Version | `v1.2` |
|
15
|
+
> | Supports Polling/Webhooks | ✔️ Yes |
|
16
|
+
> | Support Synchronous HTTP Calls | ❌ No |
|
17
|
+
> | Geography | 🌐 Global |
|
18
|
+
|
19
|
+
> 🔐 Polling Limitations
|
20
|
+
>
|
21
|
+
> | Setting | Parameter name | Default Value |
|
22
|
+
> | ------------------------------- | ----------------------- |---------------|
|
23
|
+
> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds |
|
24
|
+
> | Default Delay Between Calls | `delay_sec` | 1.5 seconds |
|
25
|
+
> | Polling Attempts Before Timeout | `max_retries` | 80 retries |
|
26
|
+
|
27
|
+
Using [this sample](https://github.com/mindee/client-lib-test-data/blob/main/products/invoice_splitter/default_sample.pdf), we are going to illustrate detect the pages of multiple invoices within the same document using the
|
28
|
+
Ruby Client Library.
|
10
29
|
|
11
30
|
# Quick-Start
|
12
31
|
|
@@ -19,7 +38,7 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
|
19
38
|
# Load a file from disk
|
20
39
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
21
40
|
|
22
|
-
result = mindee_client.
|
41
|
+
result = mindee_client.parse(
|
23
42
|
input_source,
|
24
43
|
Mindee::Product::InvoiceSplitter::InvoiceSplitterV1
|
25
44
|
)
|
@@ -79,7 +98,7 @@ The following fields are extracted for Invoice Splitter V1:
|
|
79
98
|
**invoice_page_groups** (Array<[InvoiceSplitterV1PageGroup](#invoice-splitter-v1-page-group)>): List of page indexes that belong to the same invoice in the PDF.
|
80
99
|
|
81
100
|
```rb
|
82
|
-
|
101
|
+
result.document.inference.prediction.invoice_page_groups.each do |invoice_page_groups_elem|
|
83
102
|
puts invoice_page_groups_elem.page_indexes.join(', ')
|
84
103
|
end
|
85
104
|
```
|
@@ -1,16 +1,42 @@
|
|
1
1
|
---
|
2
|
-
title:
|
2
|
+
title: Ruby Client Library - Invoice
|
3
3
|
category: 622b805aaec68102ea7fcbc2
|
4
4
|
slug: ruby-invoice-ocr
|
5
|
-
parentDoc:
|
5
|
+
parentDoc: 67b49df15b843f3fa9cd622b
|
6
6
|
---
|
7
|
-
The Ruby
|
8
|
-
|
9
|
-
|
7
|
+
The Ruby Client Library supports the [Invoice API](https://platform.mindee.com/mindee/invoices).
|
8
|
+
|
9
|
+
|
10
|
+
> 📝 Product Specs
|
11
|
+
>
|
12
|
+
> | Specification | Details |
|
13
|
+
> | ------------------------------ | -------------------------------------------------- |
|
14
|
+
> | Endpoint Name | `invoices` |
|
15
|
+
> | Recommended Version | `v4.9` |
|
16
|
+
> | Supports Polling/Webhooks | ✔️ Yes |
|
17
|
+
> | Support Synchronous HTTP Calls | ✔️ Yes |
|
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/invoices/default_sample.jpg),
|
30
|
+
we are going to illustrate how to extract the data that we want using the Ruby Client Library.
|
10
31
|

|
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
|
@@ -22,7 +48,8 @@ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
|
22
48
|
# Parse the file
|
23
49
|
result = mindee_client.parse(
|
24
50
|
input_source,
|
25
|
-
Mindee::Product::Invoice::InvoiceV4
|
51
|
+
Mindee::Product::Invoice::InvoiceV4,
|
52
|
+
enqueue: false
|
26
53
|
)
|
27
54
|
|
28
55
|
# Print a full summary of the parsed data in RST format
|
@@ -30,12 +57,16 @@ puts result.document
|
|
30
57
|
|
31
58
|
# Print the document-level parsed data
|
32
59
|
# puts result.document.inference.prediction
|
33
|
-
|
34
60
|
```
|
35
61
|
|
36
62
|
You can also call this product asynchronously:
|
37
63
|
|
38
64
|
```rb
|
65
|
+
#
|
66
|
+
# Install the Ruby client library by running:
|
67
|
+
# gem install mindee
|
68
|
+
#
|
69
|
+
|
39
70
|
require 'mindee'
|
40
71
|
|
41
72
|
# Init a new client
|
@@ -45,7 +76,7 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
|
45
76
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
46
77
|
|
47
78
|
# Parse the file
|
48
|
-
result = mindee_client.
|
79
|
+
result = mindee_client.parse(
|
49
80
|
input_source,
|
50
81
|
Mindee::Product::Invoice::InvoiceV4
|
51
82
|
)
|
@@ -55,7 +86,6 @@ puts result.document
|
|
55
86
|
|
56
87
|
# Print the document-level parsed data
|
57
88
|
# puts result.document.inference.prediction
|
58
|
-
|
59
89
|
```
|
60
90
|
|
61
91
|
**Output (RST):**
|
@@ -63,7 +93,7 @@ puts result.document
|
|
63
93
|
########
|
64
94
|
Document
|
65
95
|
########
|
66
|
-
:Mindee ID:
|
96
|
+
:Mindee ID: 86b1833f-138b-4a01-8387-860204b0e631
|
67
97
|
:Filename: default_sample.jpg
|
68
98
|
|
69
99
|
Inference
|
@@ -78,8 +108,8 @@ Prediction
|
|
78
108
|
:Purchase Order Number: AD29094
|
79
109
|
:Reference Numbers: AD29094
|
80
110
|
:Purchase Date: 2018-09-25
|
81
|
-
:Due Date:
|
82
|
-
:Payment Date:
|
111
|
+
:Due Date:
|
112
|
+
:Payment Date:
|
83
113
|
:Total Net: 2145.00
|
84
114
|
:Total Amount: 2608.20
|
85
115
|
:Total Tax: 193.20
|
@@ -124,8 +154,8 @@ Page 0
|
|
124
154
|
:Purchase Order Number: AD29094
|
125
155
|
:Reference Numbers: AD29094
|
126
156
|
:Purchase Date: 2018-09-25
|
127
|
-
:Due Date:
|
128
|
-
:Payment Date:
|
157
|
+
:Due Date:
|
158
|
+
:Payment Date:
|
129
159
|
:Total Net: 2145.00
|
130
160
|
:Total Amount: 2608.20
|
131
161
|
:Total Tax: 193.20
|
@@ -169,12 +199,12 @@ These fields are generic and used in several products.
|
|
169
199
|
Each prediction object contains a set of fields that inherit from the generic `Field` class.
|
170
200
|
A typical `Field` object will have the following attributes:
|
171
201
|
|
172
|
-
* **value** (`String`, `Float`, `Integer`, `
|
202
|
+
* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted.
|
173
203
|
* **confidence** (Float, nil): the confidence score of the field prediction.
|
174
204
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
175
205
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
176
206
|
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
177
|
-
* **reconstructed** (`
|
207
|
+
* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
178
208
|
|
179
209
|
|
180
210
|
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.
|
@@ -185,30 +215,35 @@ The amount field `AmountField` only has one constraint: its **value** is a `Floa
|
|
185
215
|
|
186
216
|
|
187
217
|
### Classification Field
|
188
|
-
The classification field `ClassificationField` does not implement all the basic `Field` attributes. It only implements
|
218
|
+
The classification field `ClassificationField` does not implement all the basic `Field` attributes. It only implements
|
219
|
+
**value**, **confidence** and **page_id**.
|
189
220
|
|
190
221
|
> Note: a classification field's `value is always a `String`.
|
191
222
|
|
192
223
|
|
193
224
|
### Company Registration Field
|
194
|
-
Aside from the basic `Field` attributes, the company registration field `CompanyRegistrationField` also implements the
|
225
|
+
Aside from the basic `Field` attributes, the company registration field `CompanyRegistrationField` also implements the
|
226
|
+
following:
|
195
227
|
|
196
228
|
* **type** (`String`): the type of company.
|
197
229
|
|
198
230
|
### Date Field
|
199
|
-
Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
|
231
|
+
Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
|
200
232
|
|
201
233
|
* **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
|
202
234
|
|
203
235
|
### Locale Field
|
204
|
-
The locale field `LocaleField` only implements the **value**, **confidence** and **page_id** base `Field` attributes,
|
236
|
+
The locale field `LocaleField` only implements the **value**, **confidence** and **page_id** base `Field` attributes,
|
237
|
+
but it comes with its own:
|
205
238
|
|
206
239
|
* **language** (`String`): ISO 639-1 language code (e.g.: `en` for English). Can be `nil`.
|
207
|
-
* **country** (`String`): ISO 3166-1 alpha-2 or ISO 3166-1 alpha-3 code for countries (e.g.: `GRB` or `GB` for "Great
|
240
|
+
* **country** (`String`): ISO 3166-1 alpha-2 or ISO 3166-1 alpha-3 code for countries (e.g.: `GRB` or `GB` for "Great
|
241
|
+
Britain"). Can be `nil`.
|
208
242
|
* **currency** (`String`): ISO 4217 code for currencies (e.g.: `USD` for "US Dollars"). Can be `nil`.
|
209
243
|
|
210
244
|
### Payment Details Field
|
211
|
-
Aside from the basic `Field` attributes, the payment details field `PaymentDetailsField` also implements the
|
245
|
+
Aside from the basic `Field` attributes, the payment details field `PaymentDetailsField` also implements the
|
246
|
+
following:
|
212
247
|
|
213
248
|
* **account_number** (`String`): number of an account, expressed as a string. Can be `nil`.
|
214
249
|
* **iban** (`String`): International Bank Account Number. Can be `nil`.
|
@@ -226,10 +261,12 @@ Aside from the basic `Field` attributes, the tax field `TaxField` also implement
|
|
226
261
|
* **code** (`String`): tax code (or equivalent, depending on the origin of the document). Can be `nil`.
|
227
262
|
* **base** (`Float`): base amount used for the tax. Can be `nil`.
|
228
263
|
|
229
|
-
> Note: currently `TaxField` is not used on its own, and is accessed through a parent `Taxes` object, an array-like
|
264
|
+
> Note: currently `TaxField` is not used on its own, and is accessed through a parent `Taxes` object, an array-like
|
265
|
+
structure.
|
230
266
|
|
231
267
|
#### Taxes (Array)
|
232
|
-
The `Taxes` field represents an array-like collection of `TaxField` objects. As it is the representation of several
|
268
|
+
The `Taxes` field represents an array-like collection of `TaxField` objects. As it is the representation of several
|
269
|
+
objects, it has access to a custom `to_s` method that can render a `TaxField` object as a table line.
|
233
270
|
|
234
271
|
## Specific Fields
|
235
272
|
Fields which are specific to this product; they are not used in any other product.
|
@@ -269,7 +306,7 @@ puts result.document.inference.prediction.customer_address.value
|
|
269
306
|
**customer_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registrations associated to the customer.
|
270
307
|
|
271
308
|
```rb
|
272
|
-
|
309
|
+
result.document.inference.prediction.customer_company_registrations do |customer_company_registrations_elem|
|
273
310
|
puts customer_company_registrations_elem.value
|
274
311
|
end
|
275
312
|
```
|
@@ -324,7 +361,7 @@ puts result.document.inference.prediction.invoice_number.value
|
|
324
361
|
**line_items** (Array<[InvoiceV4LineItem](#line-items-field)>): List of line item details.
|
325
362
|
|
326
363
|
```rb
|
327
|
-
|
364
|
+
result.document.inference.prediction.line_items do |line_items_elem|
|
328
365
|
puts line_items_elem.value
|
329
366
|
end
|
330
367
|
```
|
@@ -354,7 +391,7 @@ puts result.document.inference.prediction.po_number.value
|
|
354
391
|
**reference_numbers** (Array<[StringField](#string-field)>): List of Reference numbers, including PO number.
|
355
392
|
|
356
393
|
```rb
|
357
|
-
|
394
|
+
result.document.inference.prediction.reference_numbers do |reference_numbers_elem|
|
358
395
|
puts reference_numbers_elem.value
|
359
396
|
end
|
360
397
|
```
|
@@ -377,7 +414,7 @@ puts result.document.inference.prediction.supplier_address.value
|
|
377
414
|
**supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registrations associated to the supplier.
|
378
415
|
|
379
416
|
```rb
|
380
|
-
|
417
|
+
result.document.inference.prediction.supplier_company_registrations do |supplier_company_registrations_elem|
|
381
418
|
puts supplier_company_registrations_elem.value
|
382
419
|
end
|
383
420
|
```
|
@@ -400,11 +437,11 @@ puts result.document.inference.prediction.supplier_name.value
|
|
400
437
|
**supplier_payment_details** (Array<[PaymentDetailsField](#payment-details-field)>): List of payment details associated to the supplier.
|
401
438
|
|
402
439
|
```rb
|
403
|
-
|
440
|
+
result.document.inference.prediction.supplier_payment_details do |supplier_payment_details_elem|
|
404
441
|
puts supplier_payment_details_elem.value
|
405
|
-
|
406
|
-
|
407
|
-
|
442
|
+
puts supplier_payment_details_elem.rate
|
443
|
+
puts supplier_payment_details_elem.code
|
444
|
+
puts supplier_payment_details_elem.basis
|
408
445
|
end
|
409
446
|
```
|
410
447
|
|
@@ -426,7 +463,7 @@ puts result.document.inference.prediction.supplier_website.value
|
|
426
463
|
**taxes** (Array<[TaxField](#taxes-field)>): List of tax line details.
|
427
464
|
|
428
465
|
```rb
|
429
|
-
|
466
|
+
result.document.inference.prediction.taxes do |taxes_elem|
|
430
467
|
puts taxes_elem.value
|
431
468
|
end
|
432
469
|
```
|