mindee 4.0.0 → 4.1.2
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/CHANGELOG.md +18 -0
- data/bin/cli_products.rb +172 -0
- data/bin/mindee.rb +6 -121
- data/docs/advanced_file_operations.md +7 -9
- data/docs/code_samples/invoice_splitter_v1_async.txt +2 -1
- data/docs/code_samples/{license_plates_v1.txt → us_mail_v2_async.txt} +1 -1
- data/docs/code_samples/workflow_execution.txt +28 -0
- data/docs/getting_started.md +1 -1
- data/docs/global_products/barcode_reader_v1.md +1 -1
- data/docs/global_products/bill_of_lading_v1.md +1 -1
- data/docs/global_products/business_card_v1.md +1 -1
- data/docs/global_products/cropper_v1.md +1 -1
- data/docs/global_products/delivery_notes_v1.md +2 -2
- data/docs/global_products/driver_license_v1.md +1 -1
- data/docs/global_products/expense_receipts_v5.md +26 -25
- data/docs/global_products/financial_document_v1.md +34 -33
- data/docs/global_products/international_id_v2.md +7 -7
- data/docs/global_products/invoice_splitter_v1.md +53 -33
- data/docs/global_products/invoices_v4.md +19 -19
- data/docs/global_products/multi_receipts_detector_v1.md +1 -1
- data/docs/global_products/nutrition_facts_v1.md +1 -1
- data/docs/global_products/passport_v1.md +1 -1
- data/docs/global_products/resume_v1.md +4 -4
- data/docs/global_products/universal.md +1 -1
- data/docs/global_products.md +1 -1
- data/docs/loading_a_document.md +87 -73
- data/docs/localized_products/bank_account_details_v2.md +1 -1
- data/docs/localized_products/bank_check_v1.md +1 -1
- data/docs/localized_products/bank_statement_fr_v2.md +1 -1
- data/docs/localized_products/carte_grise_v1.md +1 -1
- data/docs/localized_products/energy_bill_fra_v1.md +11 -3
- data/docs/localized_products/french_healthcard_v1.md +1 -1
- data/docs/localized_products/idcard_fr_v2.md +6 -6
- data/docs/localized_products/ind_passport_v1.md +5 -5
- data/docs/localized_products/payslip_fra_v3.md +1 -1
- data/docs/localized_products/us_healthcare_cards_v1.md +2 -2
- data/docs/localized_products/us_mail_v3.md +1 -1
- data/docs/localized_products/us_w9_v1.md +1 -1
- data/docs/localized_products.md +1 -1
- data/lib/mindee/client.rb +6 -8
- data/lib/mindee/geometry/polygon.rb +1 -1
- data/lib/mindee/http/workflow_endpoint.rb +23 -23
- data/lib/mindee/pdf/pdf_extractor.rb +3 -3
- data/lib/mindee/product/delivery_note/delivery_note_v1_document.rb +1 -1
- data/lib/mindee/product/delivery_note/delivery_note_v1_page.rb +1 -1
- data/lib/mindee/product/financial_document/financial_document_v1_document.rb +15 -14
- data/lib/mindee/product/financial_document/financial_document_v1_line_item.rb +1 -1
- data/lib/mindee/product/financial_document/financial_document_v1_line_items.rb +1 -1
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_document.rb +5 -1
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rb +18 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rb +4 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb +2 -2
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_page.rb +1 -1
- data/lib/mindee/product/invoice/invoice_v4_document.rb +14 -14
- data/lib/mindee/product/invoice/invoice_v4_line_item.rb +2 -2
- data/lib/mindee/product/invoice/invoice_v4_line_items.rb +1 -1
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1.rb +2 -2
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb +38 -42
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb +55 -0
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_groups.rb +48 -0
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_page.rb +9 -5
- data/lib/mindee/product/receipt/receipt_v5_document.rb +8 -8
- data/lib/mindee/product/receipt/receipt_v5_line_item.rb +1 -1
- data/lib/mindee/product/receipt/receipt_v5_line_items.rb +1 -1
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb +1 -1
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb +1 -1
- data/lib/mindee/product/{eu/license_plate/license_plate_v1.rb → us/us_mail/us_mail_v2.rb} +13 -13
- data/lib/mindee/product/us/us_mail/us_mail_v2_document.rb +105 -0
- data/lib/mindee/product/{eu/license_plate/license_plate_v1_page.rb → us/us_mail/us_mail_v2_page.rb} +8 -8
- data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_address.rb +105 -0
- data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_addresses.rb +63 -0
- data/lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb +66 -0
- data/lib/mindee/product.rb +5 -5
- data/lib/mindee/version.rb +1 -1
- data/mindee.gemspec +11 -11
- data/sig/custom/net_http.rbs +5 -0
- data/sig/mindee/client.rbs +1 -0
- data/sig/mindee/http/workflow_endpoint.rbs +8 -2
- data/sig/mindee/pdf/pdf_extractor.rbs +1 -1
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rbs +1 -1
- data/sig/mindee/product/financial_document/financial_document_v1_line_items.rbs +1 -1
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2_transactions.rbs +1 -1
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rbs +2 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rbs +1 -1
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_subscriptions.rbs +1 -1
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rbs +1 -1
- data/sig/mindee/product/fr/payslip/payslip_v2_salary_details.rbs +1 -1
- data/sig/mindee/product/fr/payslip/payslip_v3_paid_time_offs.rbs +1 -1
- data/sig/mindee/product/fr/payslip/payslip_v3_salary_details.rbs +1 -1
- data/sig/mindee/product/invoice/invoice_v4_line_items.rbs +1 -1
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1.rbs +1 -4
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_document.rbs +5 -9
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rbs +14 -0
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_groups.rbs +13 -0
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_page.rbs +2 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rbs +1 -1
- data/sig/mindee/product/receipt/receipt_v5_line_items.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_certificates.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_educations.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_languages.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_professional_experiences.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_social_networks_urls.rbs +1 -1
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rbs +1 -1
- data/sig/mindee/product/us/us_mail/us_mail_v2.rbs +13 -0
- data/sig/mindee/product/us/us_mail/us_mail_v2_document.rbs +20 -0
- data/sig/mindee/product/{eu/license_plate/license_plate_v1_page.rbs → us/us_mail/us_mail_v2_page.rbs} +5 -5
- data/sig/mindee/product/us/us_mail/us_mail_v2_recipient_address.rbs +22 -0
- data/sig/mindee/product/us/us_mail/us_mail_v2_recipient_addresses.rbs +15 -0
- data/sig/mindee/product/us/us_mail/us_mail_v2_sender_address.rbs +18 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_recipient_addresses.rbs +1 -1
- metadata +39 -28
- data/docs/localized_products/license_plates_v1.md +0 -112
- data/lib/mindee/product/eu/license_plate/license_plate_v1_document.rb +0 -37
- data/sig/mindee/product/eu/license_plate/license_plate_v1.rbs +0 -13
- data/sig/mindee/product/eu/license_plate/license_plate_v1_document.rbs +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32781169244b37ef1d839e05d09ffc0c58a677b33a3f7266a2a0597e9dc0e114
|
4
|
+
data.tar.gz: 9d3793675e7bef501031be3f70454c7681b48317bffaf61be576a13c043c5c1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb14b3e6a1fe2e52bdc1d93836f0b70f91e0ddf8a3fd667ca68cc2661f145da9e3a070c0d6124d5e9ce916a1e0110abd8723afd43312043c04b2138e311c0372
|
7
|
+
data.tar.gz: 12a99519ce9fbf03c69aea9651205aa17fdd96ab8bdbd2a54ad1768304baf374c1e3f53d791375ce0f91fe66589d84bf24c3d496dc294212913dd409ce8d6322
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# Mindee Ruby API Library Changelog
|
2
2
|
|
3
|
+
## v4.1.2 - 2025-03-26
|
4
|
+
### Fixes
|
5
|
+
* :wrench: loosen version restrictions on most dependencies
|
6
|
+
|
7
|
+
|
8
|
+
## v4.1.1 - 2025-03-25
|
9
|
+
### Fixes
|
10
|
+
* :wrench: loosen pinning on base64 dependency
|
11
|
+
|
12
|
+
|
13
|
+
## v4.1.0 - 2025-03-25
|
14
|
+
### Changes
|
15
|
+
* :sparkles: bump FR EnergyBillV1 to V1.2 & US HealthcareCardV1 to V1.1
|
16
|
+
* :sparkles: restore support for US Mail V2
|
17
|
+
* :sparkles: add support for RAG in workflow executions
|
18
|
+
### Fixes
|
19
|
+
* :recycle: update CLI syntax for easier product creation
|
20
|
+
|
3
21
|
## v4.0.0 - 2025-02-27
|
4
22
|
### ¡Breaking Changes!
|
5
23
|
* :boom: drop support for ruby versions < 3.0
|
data/bin/cli_products.rb
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
PRODUCTS = {
|
4
|
+
"universal" => {
|
5
|
+
description: "Universal document type from API builder",
|
6
|
+
doc_class: Mindee::Product::Universal::Universal,
|
7
|
+
sync: true,
|
8
|
+
async: true,
|
9
|
+
},
|
10
|
+
"barcode-reader" => {
|
11
|
+
description: "Barcode Reader",
|
12
|
+
doc_class: Mindee::Product::BarcodeReader::BarcodeReaderV1,
|
13
|
+
sync: true,
|
14
|
+
async: false,
|
15
|
+
},
|
16
|
+
"bill-of-lading" => {
|
17
|
+
description: "Bill of Lading",
|
18
|
+
doc_class: Mindee::Product::BillOfLading::BillOfLadingV1,
|
19
|
+
sync: false,
|
20
|
+
async: true,
|
21
|
+
},
|
22
|
+
"business-card" => {
|
23
|
+
description: "Business Card",
|
24
|
+
doc_class: Mindee::Product::BusinessCard::BusinessCardV1,
|
25
|
+
sync: false,
|
26
|
+
async: true,
|
27
|
+
},
|
28
|
+
"cropper" => {
|
29
|
+
description: "Cropper",
|
30
|
+
doc_class: Mindee::Product::Cropper::CropperV1,
|
31
|
+
sync: true,
|
32
|
+
async: false,
|
33
|
+
},
|
34
|
+
"delivery-note" => {
|
35
|
+
description: "Delivery note",
|
36
|
+
doc_class: Mindee::Product::DeliveryNote::DeliveryNoteV1,
|
37
|
+
sync: false,
|
38
|
+
async: true,
|
39
|
+
},
|
40
|
+
"driver-license" => {
|
41
|
+
description: "Driver License",
|
42
|
+
doc_class: Mindee::Product::DriverLicense::DriverLicenseV1,
|
43
|
+
sync: false,
|
44
|
+
async: true,
|
45
|
+
},
|
46
|
+
"financial-document" => {
|
47
|
+
description: "Financial Document",
|
48
|
+
doc_class: Mindee::Product::FinancialDocument::FinancialDocumentV1,
|
49
|
+
sync: true,
|
50
|
+
async: true,
|
51
|
+
},
|
52
|
+
"fr-bank-account-details" => {
|
53
|
+
description: "Bank Account Details",
|
54
|
+
doc_class: Mindee::Product::FR::BankAccountDetails::BankAccountDetailsV2,
|
55
|
+
sync: true,
|
56
|
+
async: false,
|
57
|
+
},
|
58
|
+
"fr-bank-statement" => {
|
59
|
+
description: "Bank Statement",
|
60
|
+
doc_class: Mindee::Product::FR::BankStatement::BankStatementV2,
|
61
|
+
sync: false,
|
62
|
+
async: true,
|
63
|
+
},
|
64
|
+
"fr-carte-grise" => {
|
65
|
+
description: "Carte Grise",
|
66
|
+
doc_class: Mindee::Product::FR::CarteGrise::CarteGriseV1,
|
67
|
+
sync: true,
|
68
|
+
async: false,
|
69
|
+
},
|
70
|
+
"fr-energy-bill" => {
|
71
|
+
description: "Energy Bill",
|
72
|
+
doc_class: Mindee::Product::FR::EnergyBill::EnergyBillV1,
|
73
|
+
sync: false,
|
74
|
+
async: true,
|
75
|
+
},
|
76
|
+
"fr-health-card" => {
|
77
|
+
description: "Health Card",
|
78
|
+
doc_class: Mindee::Product::FR::HealthCard::HealthCardV1,
|
79
|
+
sync: false,
|
80
|
+
async: true,
|
81
|
+
},
|
82
|
+
"fr-carte-nationale-d-identite" => {
|
83
|
+
description: "Carte Nationale d'Identité",
|
84
|
+
doc_class: Mindee::Product::FR::IdCard::IdCardV2,
|
85
|
+
sync: true,
|
86
|
+
async: false,
|
87
|
+
},
|
88
|
+
"fr-payslip" => {
|
89
|
+
description: "Payslip",
|
90
|
+
doc_class: Mindee::Product::FR::Payslip::PayslipV3,
|
91
|
+
sync: false,
|
92
|
+
async: true,
|
93
|
+
},
|
94
|
+
"ind-passport-india" => {
|
95
|
+
description: "Passport - India",
|
96
|
+
doc_class: Mindee::Product::IND::IndianPassport::IndianPassportV1,
|
97
|
+
sync: false,
|
98
|
+
async: true,
|
99
|
+
},
|
100
|
+
"international-id" => {
|
101
|
+
description: "International ID",
|
102
|
+
doc_class: Mindee::Product::InternationalId::InternationalIdV2,
|
103
|
+
sync: false,
|
104
|
+
async: true,
|
105
|
+
},
|
106
|
+
"invoice" => {
|
107
|
+
description: "Invoice",
|
108
|
+
doc_class: Mindee::Product::Invoice::InvoiceV4,
|
109
|
+
sync: true,
|
110
|
+
async: true,
|
111
|
+
},
|
112
|
+
"invoice-splitter" => {
|
113
|
+
description: "Invoice Splitter",
|
114
|
+
doc_class: Mindee::Product::InvoiceSplitter::InvoiceSplitterV1,
|
115
|
+
sync: false,
|
116
|
+
async: true,
|
117
|
+
},
|
118
|
+
"multi-receipts-detector" => {
|
119
|
+
description: "Multi Receipts Detector",
|
120
|
+
doc_class: Mindee::Product::MultiReceiptsDetector::MultiReceiptsDetectorV1,
|
121
|
+
sync: true,
|
122
|
+
async: false,
|
123
|
+
},
|
124
|
+
"nutrition-facts-label" => {
|
125
|
+
description: "Nutrition Facts Label",
|
126
|
+
doc_class: Mindee::Product::NutritionFactsLabel::NutritionFactsLabelV1,
|
127
|
+
sync: false,
|
128
|
+
async: true,
|
129
|
+
},
|
130
|
+
"passport" => {
|
131
|
+
description: "Passport",
|
132
|
+
doc_class: Mindee::Product::Passport::PassportV1,
|
133
|
+
sync: true,
|
134
|
+
async: false,
|
135
|
+
},
|
136
|
+
"receipt" => {
|
137
|
+
description: "Receipt",
|
138
|
+
doc_class: Mindee::Product::Receipt::ReceiptV5,
|
139
|
+
sync: true,
|
140
|
+
async: true,
|
141
|
+
},
|
142
|
+
"resume" => {
|
143
|
+
description: "Resume",
|
144
|
+
doc_class: Mindee::Product::Resume::ResumeV1,
|
145
|
+
sync: false,
|
146
|
+
async: true,
|
147
|
+
},
|
148
|
+
"us-bank-check" => {
|
149
|
+
description: "Bank Check",
|
150
|
+
doc_class: Mindee::Product::US::BankCheck::BankCheckV1,
|
151
|
+
sync: true,
|
152
|
+
async: false,
|
153
|
+
},
|
154
|
+
"us-healthcare-card" => {
|
155
|
+
description: "Healthcare Card",
|
156
|
+
doc_class: Mindee::Product::US::HealthcareCard::HealthcareCardV1,
|
157
|
+
sync: false,
|
158
|
+
async: true,
|
159
|
+
},
|
160
|
+
"us-us-mail" => {
|
161
|
+
description: "US Mail",
|
162
|
+
doc_class: Mindee::Product::US::UsMail::UsMailV3,
|
163
|
+
sync: false,
|
164
|
+
async: true,
|
165
|
+
},
|
166
|
+
"us-w9" => {
|
167
|
+
description: "W9",
|
168
|
+
doc_class: Mindee::Product::US::W9::W9V1,
|
169
|
+
sync: true,
|
170
|
+
async: false,
|
171
|
+
},
|
172
|
+
}
|
data/bin/mindee.rb
CHANGED
@@ -5,122 +5,7 @@ require 'bundler/setup'
|
|
5
5
|
require 'optparse'
|
6
6
|
require 'mindee'
|
7
7
|
|
8
|
-
|
9
|
-
"universal" => {
|
10
|
-
description: "Universal document type from API builder",
|
11
|
-
doc_class: Mindee::Product::Universal::Universal,
|
12
|
-
sync: true,
|
13
|
-
async: true,
|
14
|
-
},
|
15
|
-
"cropper" => {
|
16
|
-
description: 'Cropper',
|
17
|
-
doc_class: Mindee::Product::Cropper::CropperV1,
|
18
|
-
sync: true,
|
19
|
-
async: false,
|
20
|
-
},
|
21
|
-
"financial-document" => {
|
22
|
-
description: 'Financial Document',
|
23
|
-
doc_class: Mindee::Product::FinancialDocument::FinancialDocumentV1,
|
24
|
-
sync: true,
|
25
|
-
async: true,
|
26
|
-
},
|
27
|
-
"invoice" => {
|
28
|
-
description: 'Invoice',
|
29
|
-
doc_class: Mindee::Product::Invoice::InvoiceV4,
|
30
|
-
sync: true,
|
31
|
-
async: true,
|
32
|
-
},
|
33
|
-
"international-id" => {
|
34
|
-
description: 'International Id',
|
35
|
-
doc_class: Mindee::Product::InternationalId::InternationalIdV2,
|
36
|
-
sync: false,
|
37
|
-
async: true,
|
38
|
-
},
|
39
|
-
"receipt" => {
|
40
|
-
description: "Expense Receipt",
|
41
|
-
doc_class: Mindee::Product::Receipt::ReceiptV5,
|
42
|
-
sync: true,
|
43
|
-
async: true,
|
44
|
-
},
|
45
|
-
"driver-license" => {
|
46
|
-
description: "Driver License",
|
47
|
-
doc_class: Mindee::Product::DriverLicense::DriverLicenseV1,
|
48
|
-
sync: false,
|
49
|
-
async: true,
|
50
|
-
},
|
51
|
-
"resume" => {
|
52
|
-
description: "Resume",
|
53
|
-
doc_class: Mindee::Product::Resume::ResumeV1,
|
54
|
-
sync: false,
|
55
|
-
async: true,
|
56
|
-
},
|
57
|
-
"passport" => {
|
58
|
-
description: "Passport",
|
59
|
-
doc_class: Mindee::Product::Passport::PassportV1,
|
60
|
-
sync: true,
|
61
|
-
async: false,
|
62
|
-
},
|
63
|
-
"eu-license-plate" => {
|
64
|
-
description: "EU License Plate",
|
65
|
-
doc_class: Mindee::Product::EU::LicensePlate::LicensePlateV1,
|
66
|
-
sync: true,
|
67
|
-
async: false,
|
68
|
-
},
|
69
|
-
"fr-bank-account-details" => {
|
70
|
-
description: "FR Bank Account Details",
|
71
|
-
doc_class: Mindee::Product::FR::BankAccountDetails::BankAccountDetailsV2,
|
72
|
-
sync: true,
|
73
|
-
async: false,
|
74
|
-
},
|
75
|
-
"fr-bank-statement" => {
|
76
|
-
description: "FR Bank Statement",
|
77
|
-
doc_class: Mindee::Product::FR::BankStatement::BankStatementV2,
|
78
|
-
sync: false,
|
79
|
-
async: true,
|
80
|
-
},
|
81
|
-
"fr-id-card" => {
|
82
|
-
description: "FR ID Card",
|
83
|
-
doc_class: Mindee::Product::FR::IdCard::IdCardV2,
|
84
|
-
sync: true,
|
85
|
-
async: false,
|
86
|
-
},
|
87
|
-
"fr-health-card" => {
|
88
|
-
description: "FR Health Card",
|
89
|
-
doc_class: Mindee::Product::FR::HealthCard::HealthCardV1,
|
90
|
-
sync: false,
|
91
|
-
async: true,
|
92
|
-
},
|
93
|
-
"fr-payslip" => {
|
94
|
-
description: "FR Payslip",
|
95
|
-
doc_class: Mindee::Product::FR::Payslip::PayslipV3,
|
96
|
-
sync: false,
|
97
|
-
async: true,
|
98
|
-
},
|
99
|
-
"us-bank-check" => {
|
100
|
-
description: "US Bank Check",
|
101
|
-
doc_class: Mindee::Product::US::BankCheck::BankCheckV1,
|
102
|
-
sync: true,
|
103
|
-
async: false,
|
104
|
-
},
|
105
|
-
"us-heathcare-card" => {
|
106
|
-
description: "US Healthcare Card",
|
107
|
-
doc_class: Mindee::Product::US::HealthcareCard::HealthcareCardV1,
|
108
|
-
sync: false,
|
109
|
-
async: true
|
110
|
-
},
|
111
|
-
"us-w9" => {
|
112
|
-
description: "US W9 Form",
|
113
|
-
doc_class: Mindee::Product::US::W9::W9V1,
|
114
|
-
sync: true,
|
115
|
-
async: false
|
116
|
-
},
|
117
|
-
"invoice-splitter" => {
|
118
|
-
description: "US Bank Check",
|
119
|
-
doc_class: Mindee::Product::InvoiceSplitter::InvoiceSplitterV1,
|
120
|
-
sync: false,
|
121
|
-
async: true,
|
122
|
-
},
|
123
|
-
}
|
8
|
+
require_relative 'cli_products'
|
124
9
|
|
125
10
|
options = {}
|
126
11
|
|
@@ -136,7 +21,7 @@ def custom_subcommand(cli_parser, options)
|
|
136
21
|
end
|
137
22
|
|
138
23
|
product_parser = {}
|
139
|
-
|
24
|
+
PRODUCTS.each do |doc_key, doc_value|
|
140
25
|
product_parser[doc_key] = OptionParser.new do |opts|
|
141
26
|
opts.on('-w', '--all-words', 'Include words in response') do |v|
|
142
27
|
options[:all_words] = v
|
@@ -170,14 +55,14 @@ end
|
|
170
55
|
global_parser = OptionParser.new do |opts|
|
171
56
|
opts.banner = "Usage: mindee.rb product [options] file"
|
172
57
|
opts.separator "Available products:"
|
173
|
-
opts.separator " #{
|
58
|
+
opts.separator " #{PRODUCTS.keys.join("\n ")}"
|
174
59
|
end
|
175
60
|
|
176
61
|
command = ARGV.shift
|
177
|
-
unless
|
62
|
+
unless PRODUCTS.include?(command)
|
178
63
|
abort(global_parser.help)
|
179
64
|
end
|
180
|
-
doc_class =
|
65
|
+
doc_class = PRODUCTS[command][:doc_class]
|
181
66
|
product_parser[command].parse!
|
182
67
|
|
183
68
|
if command == 'universal'
|
@@ -224,7 +109,7 @@ else
|
|
224
109
|
end
|
225
110
|
|
226
111
|
if options[:parse_async].nil?
|
227
|
-
if !
|
112
|
+
if !PRODUCTS[command][:sync]
|
228
113
|
options[:parse_async] = true
|
229
114
|
else
|
230
115
|
options[:parse_async] = false
|
@@ -6,10 +6,8 @@ parentDoc: 6294d97ee723f1008d2ab28e
|
|
6
6
|
---
|
7
7
|
|
8
8
|
> ❗️ Disclaimer: the file operations listed below do not directly manipulate the files you will pass to the library,
|
9
|
-
>
|
10
|
-
>
|
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.
|
9
|
+
> They will instead create a copy before applying any operations, which means that the file you send may not be an exact copy of the file the server will receive.
|
10
|
+
> To avoid any unexpected or unwanted result, you can save a copy of the created file locally to inspect it visually before sending it.
|
13
11
|
|
14
12
|
## Image compression
|
15
13
|
|
@@ -32,17 +30,16 @@ input_source.compress!(quality: 85, max_width: 1024, max_height: 768)
|
|
32
30
|
|
33
31
|
For reference, here's what the following levels of compression on this image will look like:
|
34
32
|
|
35
|
-
Original
|
33
|
+
**Original:**
|
36
34
|

|
37
35
|
|
38
|
-
|
39
|
-
85% compressed:
|
36
|
+
**85% compressed:**
|
40
37
|

|
41
38
|
|
42
|
-
50% compressed
|
39
|
+
**50% compressed:**
|
43
40
|

|
44
41
|
|
45
|
-
10% compressed
|
42
|
+
**10% compressed:**
|
46
43
|

|
47
44
|
|
48
45
|
|
@@ -76,6 +73,7 @@ File.write(output_file_path, pdf_input.io_stream.read)
|
|
76
73
|
|
77
74
|
> 🚧 Be warned that the source text (the text embedded in the PDF itself) might not render properly,
|
78
75
|
> and so source PDFs will be ignored by default.
|
76
|
+
>
|
79
77
|
> You can bypass this using:
|
80
78
|
|
81
79
|
```rb
|
@@ -11,6 +11,7 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
|
11
11
|
# Load a file from disk
|
12
12
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
13
13
|
|
14
|
+
# Parse the file
|
14
15
|
result = mindee_client.parse(
|
15
16
|
input_source,
|
16
17
|
Mindee::Product::InvoiceSplitter::InvoiceSplitterV1
|
@@ -20,4 +21,4 @@ result = mindee_client.parse(
|
|
20
21
|
puts result.document
|
21
22
|
|
22
23
|
# Print the document-level parsed data
|
23
|
-
# puts result.document.inference.prediction
|
24
|
+
# puts result.document.inference.prediction
|
@@ -14,7 +14,7 @@ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
|
14
14
|
# Parse the file
|
15
15
|
result = mindee_client.parse(
|
16
16
|
input_source,
|
17
|
-
Mindee::Product::
|
17
|
+
Mindee::Product::US::UsMail::UsMailV2
|
18
18
|
)
|
19
19
|
|
20
20
|
# Print a full summary of the parsed data in RST format
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#
|
2
|
+
# Install the Ruby client library by running:
|
3
|
+
# gem install mindee
|
4
|
+
#
|
5
|
+
|
6
|
+
require_relative 'mindee'
|
7
|
+
|
8
|
+
workflow_id = 'workflow-id'
|
9
|
+
|
10
|
+
# Init a new client
|
11
|
+
mindee_client = Mindee::Client.new
|
12
|
+
|
13
|
+
# Load a file from disk
|
14
|
+
input_source = mindee_client.source_from_path('path/to/my/file.ext')
|
15
|
+
|
16
|
+
# Send the file to the workflow
|
17
|
+
result = mindee_client.execute_workflow(
|
18
|
+
input_source,
|
19
|
+
workflow_id,
|
20
|
+
# options: { # Optionally, you can provide the following parameters:
|
21
|
+
# document_alias: 'my-document-alias', # Potential alias for the document
|
22
|
+
# priority: Mindee::Parsing::Common::ExecutionPriority::LOW, # Priority of the execution
|
23
|
+
# rag: true # Whether to enable Retrieval-Augmented Generation
|
24
|
+
# }
|
25
|
+
)
|
26
|
+
|
27
|
+
# Print the execution's ID to make sure it worked
|
28
|
+
puts result.execution.id
|
data/docs/getting_started.md
CHANGED
@@ -4,7 +4,7 @@ category: 622b805aaec68102ea7fcbc2
|
|
4
4
|
slug: ruby-getting-started
|
5
5
|
parentDoc: 6294d97ee723f1008d2ab28e
|
6
6
|
---
|
7
|
-
This guide will help you get the most out of the Mindee Ruby client library to easily extract data from your documents.
|
7
|
+
> 📘 This guide will help you get the most out of the Mindee Ruby client library to easily extract data from your documents.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
title:
|
2
|
+
title: Delivery note
|
3
3
|
category: 622b805aaec68102ea7fcbc2
|
4
4
|
slug: ruby-delivery-note-ocr
|
5
5
|
parentDoc: 67b49df15b843f3fa9cd622b
|
@@ -12,7 +12,7 @@ The Ruby Client Library supports the [Delivery note API](https://platform.mindee
|
|
12
12
|
> | Specification | Details |
|
13
13
|
> | ------------------------------ | -------------------------------------------------- |
|
14
14
|
> | Endpoint Name | `delivery_notes` |
|
15
|
-
> | Recommended Version | `v1.
|
15
|
+
> | Recommended Version | `v1.2` |
|
16
16
|
> | Supports Polling/Webhooks | ✔️ Yes |
|
17
17
|
> | Support Synchronous HTTP Calls | ❌ No |
|
18
18
|
> | Geography | 🌐 Global |
|
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
title:
|
2
|
+
title: Receipt
|
3
3
|
category: 622b805aaec68102ea7fcbc2
|
4
4
|
slug: ruby-receipt-ocr
|
5
5
|
parentDoc: 67b49df15b843f3fa9cd622b
|
@@ -239,7 +239,7 @@ objects, it has access to a custom `to_s` method that can render a `TaxField` ob
|
|
239
239
|
Fields which are specific to this product; they are not used in any other product.
|
240
240
|
|
241
241
|
### Line Items Field
|
242
|
-
List of line
|
242
|
+
List of all line items on the receipt.
|
243
243
|
|
244
244
|
A `ReceiptV5LineItem` implements the following attributes:
|
245
245
|
|
@@ -252,17 +252,17 @@ A `ReceiptV5LineItem` implements the following attributes:
|
|
252
252
|
The following fields are extracted for Receipt V5:
|
253
253
|
|
254
254
|
## Purchase Category
|
255
|
-
**category** ([ClassificationField](#classification-field)): The purchase category
|
255
|
+
**category** ([ClassificationField](#classification-field)): The purchase category of the receipt.
|
256
256
|
|
257
257
|
#### Possible values include:
|
258
|
-
- toll
|
259
|
-
- food
|
260
|
-
- parking
|
261
|
-
- transport
|
262
|
-
- accommodation
|
263
|
-
- gasoline
|
264
|
-
- telecom
|
265
|
-
- miscellaneous
|
258
|
+
- 'toll'
|
259
|
+
- 'food'
|
260
|
+
- 'parking'
|
261
|
+
- 'transport'
|
262
|
+
- 'accommodation'
|
263
|
+
- 'gasoline'
|
264
|
+
- 'telecom'
|
265
|
+
- 'miscellaneous'
|
266
266
|
|
267
267
|
```rb
|
268
268
|
puts result.document.inference.prediction.category.value
|
@@ -276,18 +276,18 @@ puts result.document.inference.prediction.date.value
|
|
276
276
|
```
|
277
277
|
|
278
278
|
## Document Type
|
279
|
-
**document_type** ([ClassificationField](#classification-field)):
|
279
|
+
**document_type** ([ClassificationField](#classification-field)): The type of receipt: EXPENSE RECEIPT or CREDIT CARD RECEIPT.
|
280
280
|
|
281
281
|
#### Possible values include:
|
282
|
-
-
|
283
|
-
-
|
282
|
+
- 'EXPENSE RECEIPT'
|
283
|
+
- 'CREDIT CARD RECEIPT'
|
284
284
|
|
285
285
|
```rb
|
286
286
|
puts result.document.inference.prediction.document_type.value
|
287
287
|
```
|
288
288
|
|
289
289
|
## Line Items
|
290
|
-
**line_items** (Array<[ReceiptV5LineItem](#line-items-field)>): List of line
|
290
|
+
**line_items** (Array<[ReceiptV5LineItem](#line-items-field)>): List of all line items on the receipt.
|
291
291
|
|
292
292
|
```rb
|
293
293
|
result.document.inference.prediction.line_items do |line_items_elem|
|
@@ -296,7 +296,7 @@ end
|
|
296
296
|
```
|
297
297
|
|
298
298
|
## Expense Locale
|
299
|
-
**locale** ([LocaleField](#locale-field)): The locale
|
299
|
+
**locale** ([LocaleField](#locale-field)): The locale of the document.
|
300
300
|
|
301
301
|
```rb
|
302
302
|
puts result.document.inference.prediction.locale.value
|
@@ -310,14 +310,15 @@ puts result.document.inference.prediction.receipt_number.value
|
|
310
310
|
```
|
311
311
|
|
312
312
|
## Purchase Subcategory
|
313
|
-
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory
|
313
|
+
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory of the receipt for transport and food.
|
314
314
|
|
315
315
|
#### Possible values include:
|
316
|
-
- plane
|
317
|
-
- taxi
|
318
|
-
- train
|
319
|
-
- restaurant
|
320
|
-
- shopping
|
316
|
+
- 'plane'
|
317
|
+
- 'taxi'
|
318
|
+
- 'train'
|
319
|
+
- 'restaurant'
|
320
|
+
- 'shopping'
|
321
|
+
- nil
|
321
322
|
|
322
323
|
```rb
|
323
324
|
puts result.document.inference.prediction.subcategory.value
|
@@ -331,7 +332,7 @@ puts result.document.inference.prediction.supplier_address.value
|
|
331
332
|
```
|
332
333
|
|
333
334
|
## Supplier Company Registrations
|
334
|
-
**supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company
|
335
|
+
**supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registration numbers associated to the supplier.
|
335
336
|
|
336
337
|
```rb
|
337
338
|
result.document.inference.prediction.supplier_company_registrations do |supplier_company_registrations_elem|
|
@@ -354,7 +355,7 @@ puts result.document.inference.prediction.supplier_phone_number.value
|
|
354
355
|
```
|
355
356
|
|
356
357
|
## Taxes
|
357
|
-
**taxes** (Array<[TaxField](#taxes-field)>):
|
358
|
+
**taxes** (Array<[TaxField](#taxes-field)>): The list of taxes present on the receipt.
|
358
359
|
|
359
360
|
```rb
|
360
361
|
result.document.inference.prediction.taxes do |taxes_elem|
|
@@ -391,7 +392,7 @@ puts result.document.inference.prediction.total_net.value
|
|
391
392
|
```
|
392
393
|
|
393
394
|
## Total Tax
|
394
|
-
**total_tax** ([AmountField](#amount-field)): The
|
395
|
+
**total_tax** ([AmountField](#amount-field)): The sum of all taxes.
|
395
396
|
|
396
397
|
```rb
|
397
398
|
puts result.document.inference.prediction.total_tax.value
|