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.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -1
- data/CHANGELOG.md +23 -0
- data/README.md +25 -44
- 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/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} +35 -10
- 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} +65 -28
- 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} +65 -28
- 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/{bank_statement_fr_v2.md → localized_products/bank_statement_fr_v2.md} +37 -12
- 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 +9 -3
- data/lib/mindee/product/fr/bank_statement/bank_statement_v2_document.rb +52 -20
- data/lib/mindee/product/fr/bank_statement/bank_statement_v2_page.rb +9 -5
- data/lib/mindee/product/fr/bank_statement/bank_statement_v2_transaction.rb +5 -3
- 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 +1 -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 +390 -104
- 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_driver_license_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_document.rb +0 -130
- data/lib/mindee/product/fr/bank_statement/bank_statement_v1_page.rb +0 -34
- data/lib/mindee/product/fr/bank_statement/bank_statement_v1_transaction.rb +0 -64
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f26259f4793d7a6c22538752dccf0c509298fa6223c53b1ecbe7655e6097faa
|
4
|
+
data.tar.gz: 96033b30171bee1e5117a64460fedecbdbbe86e950704875bb0d3eb03e66c05e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8e51951deec5d25e5c19a0448cb055e0531e59836d2b21d0b51a019155adfe100582ba636fd2e14233f146cefdafcfc04a55435b02db508efff9d9a6774ce50
|
7
|
+
data.tar.gz: 816b54d06da35b3075d0f353bb330b5cc1ef8a42e6669161f9db48b2148b86f0e02f6a205c38bba952e67777d3a7b604b14c73249af3cb6cd888f52834e05277
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
1
|
# Mindee Ruby API Library Changelog
|
2
2
|
|
3
|
+
## v4.0.0 - 2025-02-27
|
4
|
+
### ¡Breaking Changes!
|
5
|
+
* :boom: drop support for ruby versions < 3.0
|
6
|
+
* :boom: refactor error-handling
|
7
|
+
* :boom: merge enqueue_and_parse() into parse()
|
8
|
+
* :boom: allow access to page-level extras, even when the page predictions are empty
|
9
|
+
* :boom: deprecate CustomV1 & GeneratedV1 in favor of Universal
|
10
|
+
### Changes
|
11
|
+
* :sparkles: add support for logging
|
12
|
+
* :sparkles: add typing support through RBS
|
13
|
+
* :sparkles: add support for multiple feature classes, inheriting from Array
|
14
|
+
* :recycle: refactor internal modules
|
15
|
+
* :recycle: refactor test module
|
16
|
+
* :coffin: remove support for US Mail V2
|
17
|
+
* :coffin: remove support for FR Bank Statement V1
|
18
|
+
* :recycle: update `UrlInputSource` to `URLInputSource`
|
19
|
+
* :memo: update documentation structure
|
20
|
+
### Fixes
|
21
|
+
* :bug: fix miscellaneous bugs relating to image extraction
|
22
|
+
* :bug: fix miscellaneous bugs relating to pdf extraction
|
23
|
+
* :bug: fix improper saving mechanism
|
24
|
+
|
25
|
+
|
3
26
|
## v3.20.0 - 2025-02-26
|
4
27
|
### Changes
|
5
28
|
* :sparkles: add support for FR Banks Statement V2
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Quickly and easily connect to Mindee's API services using Ruby.
|
|
6
6
|
|
7
7
|
## Requirements
|
8
8
|
|
9
|
-
The following Ruby versions are tested and supported:
|
9
|
+
The following Ruby versions are tested and supported: 3.0, 3.1, 3.2, 3.3, 3.4
|
10
10
|
|
11
11
|
## Quick Start
|
12
12
|
|
@@ -39,15 +39,18 @@ specific reason. Accidentally overwriting them can lead to unexpected behavior.
|
|
39
39
|
Before making any changes, we recommend reviewing the following information to understand the purpose and potential
|
40
40
|
impact of each environment variable:
|
41
41
|
|
42
|
-
* `MINDEE_API_KEY`:
|
43
|
-
|
44
|
-
|
42
|
+
* `MINDEE_API_KEY`:
|
43
|
+
* **Description**: Your personal Mindee API Key as shown on the platform. Be careful not to show this publicly!
|
44
|
+
* **Default Value**: `nil`
|
45
45
|
* `MINDEE_BASE_URL`:
|
46
|
-
|
47
|
-
|
46
|
+
* **Description**: The default base URL of the API endpoint. Use this variable to specify the root URL for API requests. Modify as needed for proxy configurations or changes in API endpoint location.
|
47
|
+
* **Default Value**: `https://api.mindee.net/v1`
|
48
48
|
* `MINDEE_REQUEST_TIMEOUT`:
|
49
|
-
|
50
|
-
|
49
|
+
* **Description**: The default timeout for HTTP requests (in seconds).
|
50
|
+
* **Default Value**: `120`
|
51
|
+
* `MINDEE_LOG_LEVEL`:
|
52
|
+
* **Description**: The default logging level for the mindee logger.
|
53
|
+
* **Default Value**: `WARN`
|
51
54
|
|
52
55
|
### Loading a File and Parsing It
|
53
56
|
|
@@ -62,8 +65,8 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
|
62
65
|
# Load a file from disk
|
63
66
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
64
67
|
result = mindee_client.parse(
|
65
|
-
|
66
|
-
|
68
|
+
input_source,
|
69
|
+
Mindee::Product::Invoice::InvoiceV4
|
67
70
|
)
|
68
71
|
|
69
72
|
# Print a full summary of the parsed data in RST format
|
@@ -108,15 +111,17 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
|
108
111
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
109
112
|
|
110
113
|
result = mindee_client.parse(
|
111
|
-
|
112
|
-
|
114
|
+
input_source,
|
115
|
+
Mindee::Product::EU::LicensePlate::LicensePlateV1
|
113
116
|
)
|
114
117
|
|
115
118
|
# Print a full summary of the parsed data in RST format
|
116
119
|
puts result.document
|
117
120
|
```
|
118
121
|
|
119
|
-
###
|
122
|
+
### Universal - All Other Documents
|
123
|
+
|
124
|
+
The Universal product acts as a catch-all for every and any API if it doesn't have an assigned product name.
|
120
125
|
|
121
126
|
```ruby
|
122
127
|
require 'mindee'
|
@@ -131,9 +136,9 @@ endpoint = mindee_client.create_endpoint(
|
|
131
136
|
# Load a file from disk
|
132
137
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
133
138
|
|
134
|
-
result = mindee_client.
|
139
|
+
result = mindee_client.parse(
|
135
140
|
input_source,
|
136
|
-
Mindee::Product::
|
141
|
+
Mindee::Product::Universal::Universal,
|
137
142
|
endpoint: endpoint
|
138
143
|
)
|
139
144
|
|
@@ -147,15 +152,10 @@ result.document.inference.prediction.fields.each do |field_name, field_data|
|
|
147
152
|
puts field_data.to_s
|
148
153
|
end
|
149
154
|
```
|
150
|
-
## Asynchronously Parsing a File
|
151
|
-
|
152
|
-
This allows for easier handling of bursts of documents sent.
|
153
155
|
|
154
|
-
Some products are only available asynchronously, check the example code
|
155
|
-
directly on the Mindee platform.
|
156
156
|
|
157
|
+
## Enqueueing and Parse a Webhook Response
|
157
158
|
|
158
|
-
### Enqueue and Parse a Webhook Response
|
159
159
|
This is an optional way of handling asynchronous APIs.
|
160
160
|
|
161
161
|
```rb
|
@@ -168,7 +168,7 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
|
168
168
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
169
169
|
|
170
170
|
|
171
|
-
#
|
171
|
+
# Send the file to the server
|
172
172
|
enqueue_response = mindee_client.enqueue(
|
173
173
|
input_source,
|
174
174
|
Mindee::Product::InternationalId::InternationalIdV2
|
@@ -225,28 +225,9 @@ There's more to it than that for those that need more features, or want to
|
|
225
225
|
customize the experience.
|
226
226
|
|
227
227
|
* [Ruby Overview](https://developers.mindee.com/docs/ruby-getting-started)
|
228
|
-
* [
|
229
|
-
* [
|
230
|
-
* [
|
231
|
-
* [International Id OCR Ruby](https://developers.mindee.com/docs/ruby-international-id-ocr)
|
232
|
-
* [Financial Document OCR Ruby](https://developers.mindee.com/docs/ruby-financial-document-ocr)
|
233
|
-
* [Passport OCR Ruby](https://developers.mindee.com/docs/ruby-passport-ocr)
|
234
|
-
* [Proof of Address OCR Ruby](https://developers.mindee.com/docs/ruby-proof-of-address-ocr)
|
235
|
-
* [Receipt OCR Ruby](https://developers.mindee.com/docs/ruby-receipt-ocr)
|
236
|
-
* [Resume OCR Ruby](https://developers.mindee.com/docs/ruby-resume-ocr)
|
237
|
-
* [EU License Plate OCR Ruby](https://developers.mindee.com/docs/ruby-eu-license-plate-ocr)
|
238
|
-
* [EU Driver License OCR Ruby](https://developers.mindee.com/docs/ruby-eu-driver-license-ocr)
|
239
|
-
* [FR Bank Account Details OCR Ruby](https://developers.mindee.com/docs/ruby-fr-bank-account-details-ocr)
|
240
|
-
* [FR Bank Statement OCR Ruby](https://developers.mindee.com/docs/ruby-fr-bank-statement-ocr)
|
241
|
-
* [FR Health Card OCR Ruby](https://developers.mindee.com/docs/ruby-fr-health-card-ocr)
|
242
|
-
* [FR ID Card OCR Ruby](https://developers.mindee.com/docs/ruby-fr-carte-nationale-didentite-ocr)
|
243
|
-
* [US Bank Check OCR Ruby](https://developers.mindee.com/docs/ruby-us-bank-check-ocr)
|
244
|
-
* [US Driver License OCR Ruby](https://developers.mindee.com/docs/ruby-us-driver-license-ocr)
|
245
|
-
* [US W9 API Ruby](https://developers.mindee.com/docs/ruby-us-w9-ocr)
|
246
|
-
* [Barcode Reader API Ruby](https://developers.mindee.com/docs/ruby-barcode-reader-ocr)
|
247
|
-
* [Cropper API Ruby](https://developers.mindee.com/docs/ruby-cropper-ocr)
|
248
|
-
* [Invoice Splitter API Ruby](https://developers.mindee.com/docs/ruby-invoice-splitter-ocr)
|
249
|
-
* [Multi Receipts Detector API Ruby](https://developers.mindee.com/docs/ruby-multi-receipts-detector-ocr)
|
228
|
+
* [Common file operations](https://developers.mindee.com/docs/ruby-common-file-operations)
|
229
|
+
* [Global products](https://developers.mindee.com/docs/ruby-global-products)
|
230
|
+
* [Localized products](https://developers.mindee.com/docs/ruby-localized-products)
|
250
231
|
|
251
232
|
You can also take a look at the
|
252
233
|
[Reference Documentation](https://mindee.github.io/mindee-api-ruby/).
|
data/Steepfile
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
D = Steep::Diagnostic
|
4
|
+
|
5
|
+
target :lib do
|
6
|
+
signature 'sig/custom/*.rbs'
|
7
|
+
signature 'sig/mindee/**/*.rbs'
|
8
|
+
|
9
|
+
check 'lib/mindee/**/*.rb'
|
10
|
+
# check 'bin' # CLI files are ignored
|
11
|
+
|
12
|
+
# NOTE: Steep does not support some libraries:
|
13
|
+
# - net/http.
|
14
|
+
# - marcel
|
15
|
+
# - mini_magick
|
16
|
+
# - origami (my bad)
|
17
|
+
# Do NOT enable them.
|
18
|
+
# Use the stubs located at sig/custom/<library_name>.rbs instead.
|
19
|
+
library 'date'
|
20
|
+
library 'fileutils'
|
21
|
+
library 'logger'
|
22
|
+
library 'json'
|
23
|
+
library 'openssl'
|
24
|
+
library 'pathname'
|
25
|
+
library 'tempfile'
|
26
|
+
library 'time'
|
27
|
+
library 'uri'
|
28
|
+
|
29
|
+
configure_code_diagnostics(D::Ruby.default) # `default` diagnostics setting (applies by default)
|
30
|
+
end
|
31
|
+
|
data/bin/mindee.rb
CHANGED
@@ -5,26 +5,13 @@ require 'bundler/setup'
|
|
5
5
|
require 'optparse'
|
6
6
|
require 'mindee'
|
7
7
|
|
8
|
-
options = {}
|
9
8
|
DOCUMENTS = {
|
10
|
-
"
|
11
|
-
description: "
|
12
|
-
doc_class: Mindee::Product::
|
13
|
-
sync: true,
|
14
|
-
async: false,
|
15
|
-
},
|
16
|
-
"generated" => {
|
17
|
-
description: "Generated document type from API builder",
|
18
|
-
doc_class: Mindee::Product::Generated::GeneratedV1,
|
9
|
+
"universal" => {
|
10
|
+
description: "Universal document type from API builder",
|
11
|
+
doc_class: Mindee::Product::Universal::Universal,
|
19
12
|
sync: true,
|
20
13
|
async: true,
|
21
14
|
},
|
22
|
-
"proof-of-address" => {
|
23
|
-
description: 'Proof of Address',
|
24
|
-
doc_class: Mindee::Product::ProofOfAddress::ProofOfAddressV1,
|
25
|
-
sync: true,
|
26
|
-
async: false,
|
27
|
-
},
|
28
15
|
"cropper" => {
|
29
16
|
description: 'Cropper',
|
30
17
|
doc_class: Mindee::Product::Cropper::CropperV1,
|
@@ -79,12 +66,6 @@ DOCUMENTS = {
|
|
79
66
|
sync: true,
|
80
67
|
async: false,
|
81
68
|
},
|
82
|
-
"eu-driver-license" => {
|
83
|
-
description: "EU Driver License",
|
84
|
-
doc_class: Mindee::Product::EU::DriverLicense::DriverLicenseV1,
|
85
|
-
sync: true,
|
86
|
-
async: false,
|
87
|
-
},
|
88
69
|
"fr-bank-account-details" => {
|
89
70
|
description: "FR Bank Account Details",
|
90
71
|
doc_class: Mindee::Product::FR::BankAccountDetails::BankAccountDetailsV2,
|
@@ -93,7 +74,7 @@ DOCUMENTS = {
|
|
93
74
|
},
|
94
75
|
"fr-bank-statement" => {
|
95
76
|
description: "FR Bank Statement",
|
96
|
-
doc_class: Mindee::Product::FR::BankStatement::
|
77
|
+
doc_class: Mindee::Product::FR::BankStatement::BankStatementV2,
|
97
78
|
sync: false,
|
98
79
|
async: true,
|
99
80
|
},
|
@@ -121,12 +102,6 @@ DOCUMENTS = {
|
|
121
102
|
sync: true,
|
122
103
|
async: false,
|
123
104
|
},
|
124
|
-
"us-driver-license" => {
|
125
|
-
description: "US Driver License",
|
126
|
-
doc_class: Mindee::Product::US::DriverLicense::DriverLicenseV1,
|
127
|
-
sync: true,
|
128
|
-
async: false,
|
129
|
-
},
|
130
105
|
"us-heathcare-card" => {
|
131
106
|
description: "US Healthcare Card",
|
132
107
|
doc_class: Mindee::Product::US::HealthcareCard::HealthcareCardV1,
|
@@ -148,13 +123,8 @@ DOCUMENTS = {
|
|
148
123
|
}
|
149
124
|
|
150
125
|
options = {}
|
151
|
-
DEFAULT_CUTTING = {
|
152
|
-
page_indexes: [0, 1, 2, 3, 4],
|
153
|
-
operation: :KEEP_ONLY,
|
154
|
-
on_min_pages: 0,
|
155
|
-
}
|
156
126
|
|
157
|
-
# Initializes
|
127
|
+
# Initializes universal-specific options
|
158
128
|
# @param cli_parser [OptionParser]
|
159
129
|
def custom_subcommand(cli_parser, options)
|
160
130
|
cli_parser.on('-v [VERSION]', '--version [VERSION]', 'Model version for the API') do |v|
|
@@ -171,7 +141,7 @@ DOCUMENTS.each do |doc_key, doc_value|
|
|
171
141
|
opts.on('-w', '--all-words', 'Include words in response') do |v|
|
172
142
|
options[:all_words] = v
|
173
143
|
end
|
174
|
-
opts.on('-c', '--cut-pages', "
|
144
|
+
opts.on('-c', '--cut-pages', "Cut document pages") do |v|
|
175
145
|
options[:cut_pages] = v
|
176
146
|
end
|
177
147
|
opts.on('-k [KEY]', '--key [KEY]', 'API key for the endpoint') do |v|
|
@@ -181,12 +151,10 @@ DOCUMENTS.each do |doc_key, doc_value|
|
|
181
151
|
options[:print_full] = true
|
182
152
|
end
|
183
153
|
opts.on('-F', '--fix-pdf', "Attempts to fix broken PDF files before sending them to the server.") do |v|
|
184
|
-
options[:
|
154
|
+
options[:repair_pdf] = true
|
185
155
|
end
|
186
|
-
if
|
187
|
-
opts.banner = "
|
188
|
-
else
|
189
|
-
opts.banner = "#{doc_value[:description]}. \nUsage: \nmindee.rb custom [options] endpoint_name file\nor\nmindee.rb generated [options] endpoint_name file"
|
156
|
+
if doc_key != 'universal'
|
157
|
+
opts.banner = "#{doc_value[:description]}. \nUsage: \nmindee.rb universal [options] endpoint_name file\nor\nmindee.rb universal [options] endpoint_name file"
|
190
158
|
custom_subcommand(opts, options)
|
191
159
|
end
|
192
160
|
if doc_value[:async]
|
@@ -206,13 +174,13 @@ global_parser = OptionParser.new do |opts|
|
|
206
174
|
end
|
207
175
|
|
208
176
|
command = ARGV.shift
|
209
|
-
|
177
|
+
unless DOCUMENTS.include?(command)
|
210
178
|
abort(global_parser.help)
|
211
179
|
end
|
212
180
|
doc_class = DOCUMENTS[command][:doc_class]
|
213
181
|
product_parser[command].parse!
|
214
182
|
|
215
|
-
if command == '
|
183
|
+
if command == 'universal'
|
216
184
|
if ARGV.length < 2
|
217
185
|
$stderr.puts "The '#{command}' command requires both ENDPOINT_NAME and file arguments."
|
218
186
|
abort(product_parser[command].help)
|
@@ -229,13 +197,13 @@ else
|
|
229
197
|
end
|
230
198
|
|
231
199
|
mindee_client = Mindee::Client.new(api_key: options[:api_key])
|
232
|
-
if
|
200
|
+
if options[:file_path].start_with?("https://")
|
233
201
|
input_source = mindee_client.source_from_url(options[:file_path])
|
234
202
|
else
|
235
|
-
input_source = mindee_client.source_from_path(options[:file_path],
|
203
|
+
input_source = mindee_client.source_from_path(options[:file_path], repair_pdf: options[:repair_pdf])
|
236
204
|
end
|
237
205
|
|
238
|
-
if command == '
|
206
|
+
if command == 'universal'
|
239
207
|
custom_endpoint = mindee_client.create_endpoint(
|
240
208
|
endpoint_name: endpoint_name,
|
241
209
|
account_name: options[:account_name],
|
@@ -245,7 +213,16 @@ else
|
|
245
213
|
custom_endpoint = nil
|
246
214
|
end
|
247
215
|
|
248
|
-
|
216
|
+
if options[:cut_pages].nil? || !options[:cut_pages].is_a?(Integer) || options[:cut_pages] < 0
|
217
|
+
page_options = options[:cut_pages].nil?
|
218
|
+
else
|
219
|
+
page_options = Mindee::PageOptions.new(params: {
|
220
|
+
page_indexes: (0..options[:cut_pages].to_i).to_a,
|
221
|
+
operation: :KEEP_ONLY,
|
222
|
+
on_min_pages: 0,
|
223
|
+
})
|
224
|
+
end
|
225
|
+
|
249
226
|
if options[:parse_async].nil?
|
250
227
|
if !DOCUMENTS[command][:sync]
|
251
228
|
options[:parse_async] = true
|
@@ -253,21 +230,12 @@ if options[:parse_async].nil?
|
|
253
230
|
options[:parse_async] = false
|
254
231
|
end
|
255
232
|
end
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
)
|
263
|
-
else
|
264
|
-
result = mindee_client.parse(
|
265
|
-
input_source,
|
266
|
-
DOCUMENTS[command][:doc_class],
|
267
|
-
endpoint: custom_endpoint,
|
268
|
-
page_options: page_options,
|
269
|
-
)
|
270
|
-
end
|
233
|
+
result = mindee_client.parse(
|
234
|
+
input_source,
|
235
|
+
doc_class,
|
236
|
+
options: { endpoint: custom_endpoint,
|
237
|
+
options: Mindee::ParseOptions.new(params: { page_options: page_options }), enqueue: options[:parse_async] }
|
238
|
+
)
|
271
239
|
|
272
240
|
if options[:print_full]
|
273
241
|
puts result.document
|
@@ -0,0 +1,111 @@
|
|
1
|
+
---
|
2
|
+
title: Advanced File Operations
|
3
|
+
category: 622b805aaec68102ea7fcbc2
|
4
|
+
slug: ruby-advanced-file-operations
|
5
|
+
parentDoc: 6294d97ee723f1008d2ab28e
|
6
|
+
---
|
7
|
+
|
8
|
+
> ❗️ Disclaimer: the file operations listed below do not directly manipulate the files you will pass to the library,
|
9
|
+
> they will instead create a copy before applying any operations, which means that the file you send may not be an
|
10
|
+
> exact copy of the file the server will receive.
|
11
|
+
> To avoid any unexpected or unwanted result, you can save a copy of the created file locally to inspect it visually
|
12
|
+
> before sending it.
|
13
|
+
|
14
|
+
## Image compression
|
15
|
+
|
16
|
+
The compression functionality for image files (JPEG, PNG, etc.) via the `compress!` method available on a
|
17
|
+
LocalInputSource. This method allows you to reduce file size by specifying quality and dimension constraints.
|
18
|
+
|
19
|
+
Example:
|
20
|
+
|
21
|
+
```rb
|
22
|
+
# Compress an image with custom parameters.
|
23
|
+
input_source.compress!(quality: 85, max_width: 1024, max_height: 768)
|
24
|
+
```
|
25
|
+
> ⚠️ Warning: Compression alters the original image data.
|
26
|
+
> We strongly advise you inspect a compressed file before sending it:
|
27
|
+
> ```rb
|
28
|
+
> # Compress using a quality of 50%:
|
29
|
+
> input_source.compress!(quality: 50)
|
30
|
+
> input_source.write_to_file('path/to/my/compressed/file_50.jpg')
|
31
|
+
> ```
|
32
|
+
|
33
|
+
For reference, here's what the following levels of compression on this image will look like:
|
34
|
+
|
35
|
+
Original:
|
36
|
+

|
37
|
+
|
38
|
+
|
39
|
+
85% compressed:
|
40
|
+

|
41
|
+
|
42
|
+
50% compressed:
|
43
|
+

|
44
|
+
|
45
|
+
10% compressed:
|
46
|
+

|
47
|
+
|
48
|
+
|
49
|
+
## PDF operations
|
50
|
+
|
51
|
+
PDF operations include both compression and fixing features.
|
52
|
+
These are specifically designed to handle challenges associated with PDF files, such as large file sizes and formatting
|
53
|
+
issues.
|
54
|
+
|
55
|
+
### PDF compression
|
56
|
+
|
57
|
+
> 🧪 PDF compression is an **experimental** feature that rasterizes each page of the PDF (similar to how images are
|
58
|
+
> compressed) to reduce its overall size.
|
59
|
+
>
|
60
|
+
> Because the process involves re-rendering the PDF’s contents, some source text may be lost or rendered differently.
|
61
|
+
> Use this feature with caution.
|
62
|
+
|
63
|
+
|
64
|
+
```rb
|
65
|
+
# Load a local input source.
|
66
|
+
input_file_path = "path/to/your/file.pdf"
|
67
|
+
output_file_path = "path/to/the/compressed/file.pdf"
|
68
|
+
pdf_input = Mindee::Input::Source::PathInputSource.new(input_file_path)
|
69
|
+
|
70
|
+
# We advise you test the quality value yourself, as results may vary greatly depending on the input file
|
71
|
+
pdf_input.compress!(quality: 50)
|
72
|
+
|
73
|
+
# Write the output file locally for visual checking:
|
74
|
+
File.write(output_file_path, pdf_input.io_stream.read)
|
75
|
+
```
|
76
|
+
|
77
|
+
> 🚧 Be warned that the source text (the text embedded in the PDF itself) might not render properly,
|
78
|
+
> and so source PDFs will be ignored by default.
|
79
|
+
> You can bypass this using:
|
80
|
+
|
81
|
+
```rb
|
82
|
+
pdf_input.compress!(quality: 50, force_source_text: true)
|
83
|
+
```
|
84
|
+
|
85
|
+
Or alternatively, you can try to approximate the re-rendering of the source-text using:
|
86
|
+
|
87
|
+
```rb
|
88
|
+
pdf_input.compress!(quality: 50, force_source_text: true, disable_source_text: false)
|
89
|
+
```
|
90
|
+
|
91
|
+
### PDF Repair
|
92
|
+
|
93
|
+
The PDF repair feature attempts to rescue PDFs with invalid or broken header information.
|
94
|
+
This can sometimes help when files get rejected by the server.
|
95
|
+
|
96
|
+
Example:
|
97
|
+
```rb
|
98
|
+
# Load a PDF file with the repair_pdf flag enabled.
|
99
|
+
input_source = mindee_client.source_from_file(file, "document.pdf", repair_pdf: true)
|
100
|
+
```
|
101
|
+
|
102
|
+
> ⚠️ Warning: PDF fixing alters the input file by re-writing header information.
|
103
|
+
> Use this feature only when required, as it might affect the integrity of the document file.
|
104
|
+
|
105
|
+
---
|
106
|
+
|
107
|
+
Feel free to expand these examples and adjust the parameters as needed for your projects. For further details on
|
108
|
+
authentication and usage, you can refer to the [Getting Started Guide](getting_started.md).
|
109
|
+
|
110
|
+
# Questions?
|
111
|
+
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
|
@@ -1,3 +1,8 @@
|
|
1
|
+
#
|
2
|
+
# Install the Ruby client library by running:
|
3
|
+
# gem install mindee
|
4
|
+
#
|
5
|
+
|
1
6
|
require 'mindee'
|
2
7
|
|
3
8
|
# Init a new client
|
@@ -7,7 +12,7 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
|
7
12
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
8
13
|
|
9
14
|
# Parse the file
|
10
|
-
result = mindee_client.
|
15
|
+
result = mindee_client.parse(
|
11
16
|
input_source,
|
12
17
|
Mindee::Product::FR::BankStatement::BankStatementV2
|
13
18
|
)
|
@@ -1,3 +1,8 @@
|
|
1
|
+
#
|
2
|
+
# Install the Ruby client library by running:
|
3
|
+
# gem install mindee
|
4
|
+
#
|
5
|
+
|
1
6
|
require 'mindee'
|
2
7
|
|
3
8
|
# Init a new client
|
@@ -7,7 +12,7 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
|
7
12
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
8
13
|
|
9
14
|
# Parse the file
|
10
|
-
result = mindee_client.
|
15
|
+
result = mindee_client.parse(
|
11
16
|
input_source,
|
12
17
|
Mindee::Product::BillOfLading::BillOfLadingV1
|
13
18
|
)
|
@@ -1,3 +1,8 @@
|
|
1
|
+
#
|
2
|
+
# Install the Ruby client library by running:
|
3
|
+
# gem install mindee
|
4
|
+
#
|
5
|
+
|
1
6
|
require 'mindee'
|
2
7
|
|
3
8
|
# Init a new client
|
@@ -7,7 +12,7 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
|
7
12
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
8
13
|
|
9
14
|
# Parse the file
|
10
|
-
result = mindee_client.
|
15
|
+
result = mindee_client.parse(
|
11
16
|
input_source,
|
12
17
|
Mindee::Product::BusinessCard::BusinessCardV1
|
13
18
|
)
|
@@ -1,3 +1,8 @@
|
|
1
|
+
#
|
2
|
+
# Install the Ruby client library by running:
|
3
|
+
# gem install mindee
|
4
|
+
#
|
5
|
+
|
1
6
|
require 'mindee'
|
2
7
|
|
3
8
|
# Init a new client
|
@@ -16,8 +21,9 @@ custom_endpoint = mindee_client.create_endpoint(
|
|
16
21
|
# Parse the file
|
17
22
|
result = mindee_client.parse(
|
18
23
|
input_source,
|
19
|
-
Mindee::Product::
|
20
|
-
endpoint: custom_endpoint
|
24
|
+
Mindee::Product::Universal::Universal,
|
25
|
+
endpoint: custom_endpoint,
|
26
|
+
enqueue: false
|
21
27
|
)
|
22
28
|
|
23
29
|
# Print a full summary of the parsed data in RST format
|
@@ -1,3 +1,8 @@
|
|
1
|
+
#
|
2
|
+
# Install the Ruby client library by running:
|
3
|
+
# gem install mindee
|
4
|
+
#
|
5
|
+
|
1
6
|
require 'mindee'
|
2
7
|
|
3
8
|
# Init a new client
|
@@ -14,9 +19,9 @@ custom_endpoint = mindee_client.create_endpoint(
|
|
14
19
|
)
|
15
20
|
|
16
21
|
# Parse the file
|
17
|
-
result = mindee_client.
|
22
|
+
result = mindee_client.parse(
|
18
23
|
input_source,
|
19
|
-
Mindee::Product::
|
24
|
+
Mindee::Product::Universal::Universal,
|
20
25
|
endpoint: custom_endpoint
|
21
26
|
)
|
22
27
|
|