mindee 3.4.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +6 -1
  4. data/bin/mindee.rb +45 -15
  5. data/docs/bank_account_details_v2.md +1 -1
  6. data/docs/bank_check_v1.md +1 -1
  7. data/docs/bank_statement_fr_v1.md +175 -0
  8. data/docs/barcode_reader_v1.md +1 -1
  9. data/docs/carte_grise_v1.md +5 -5
  10. data/docs/carte_vitale_v1.md +1 -1
  11. data/docs/code_samples/bank_statement_fr_v1_async.txt +19 -0
  12. data/docs/code_samples/default.txt +19 -19
  13. data/docs/code_samples/default_async.txt +25 -0
  14. data/docs/code_samples/eu_driver_license_v1.txt +19 -0
  15. data/docs/code_samples/international_id_v1_async.txt +19 -0
  16. data/docs/code_samples/international_id_v2_async.txt +19 -0
  17. data/docs/code_samples/resume_v1_async.txt +19 -0
  18. data/docs/cropper_v1.md +1 -1
  19. data/docs/custom_v1.md +1 -1
  20. data/docs/eu_driver_license_v1.md +223 -0
  21. data/docs/expense_receipts_v5.md +1 -1
  22. data/docs/financial_document_v1.md +49 -41
  23. data/docs/generated_v1.md +90 -0
  24. data/docs/getting_started.md +1 -1
  25. data/docs/idcard_fr_v2.md +1 -1
  26. data/docs/international_id_v2.md +195 -0
  27. data/docs/invoice_splitter_v1.md +1 -1
  28. data/docs/invoices_v4.md +5 -2
  29. data/docs/license_plates_v1.md +1 -1
  30. data/docs/multi_receipts_detector_v1.md +1 -1
  31. data/docs/passport_v1.md +1 -1
  32. data/docs/proof_of_address_v1.md +5 -5
  33. data/docs/resume_v1.md +334 -0
  34. data/docs/us_driver_license_v1.md +3 -3
  35. data/docs/us_w9_v1.md +1 -1
  36. data/lib/mindee/client.rb +5 -3
  37. data/lib/mindee/http/endpoint.rb +13 -12
  38. data/lib/mindee/input/sources.rb +28 -5
  39. data/lib/mindee/parsing/common/inference.rb +3 -1
  40. data/lib/mindee/parsing/generated/generated_list_field.rb +58 -0
  41. data/lib/mindee/parsing/generated/generated_object_field.rb +109 -0
  42. data/lib/mindee/parsing/generated.rb +4 -0
  43. data/lib/mindee/parsing/standard/base_field.rb +1 -1
  44. data/lib/mindee/parsing.rb +1 -0
  45. data/lib/mindee/product/.rubocop.yml +7 -2
  46. data/lib/mindee/product/barcode_reader/barcode_reader_v1.rb +3 -1
  47. data/lib/mindee/product/cropper/cropper_v1.rb +3 -1
  48. data/lib/mindee/product/eu/driver_license/driver_license_v1.rb +41 -0
  49. data/lib/mindee/product/eu/driver_license/driver_license_v1_document.rb +88 -0
  50. data/lib/mindee/product/eu/driver_license/driver_license_v1_page.rb +53 -0
  51. data/lib/mindee/product/eu/license_plate/license_plate_v1.rb +3 -1
  52. data/lib/mindee/product/financial_document/financial_document_v1.rb +3 -1
  53. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1.rb +3 -1
  54. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2.rb +3 -1
  55. data/lib/mindee/product/fr/bank_statement/bank_statement_v1.rb +41 -0
  56. data/lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb +130 -0
  57. data/lib/mindee/product/fr/bank_statement/bank_statement_v1_page.rb +34 -0
  58. data/lib/mindee/product/fr/bank_statement/bank_statement_v1_transaction.rb +64 -0
  59. data/lib/mindee/product/fr/carte_grise/carte_grise_v1.rb +3 -1
  60. data/lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb +0 -2
  61. data/lib/mindee/product/fr/carte_vitale/carte_vitale_v1.rb +3 -1
  62. data/lib/mindee/product/fr/id_card/id_card_v1.rb +3 -1
  63. data/lib/mindee/product/fr/id_card/id_card_v2.rb +3 -1
  64. data/lib/mindee/product/generated/generated_v1.rb +38 -0
  65. data/lib/mindee/product/generated/generated_v1_document.rb +35 -0
  66. data/lib/mindee/product/generated/generated_v1_page.rb +51 -0
  67. data/lib/mindee/product/generated/generated_v1_prediction.rb +114 -0
  68. data/lib/mindee/product/international_id/international_id_v1.rb +39 -0
  69. data/lib/mindee/product/international_id/international_id_v1_document.rb +109 -0
  70. data/lib/mindee/product/international_id/international_id_v1_page.rb +32 -0
  71. data/lib/mindee/product/international_id/international_id_v2.rb +39 -0
  72. data/lib/mindee/product/international_id/international_id_v2_document.rb +119 -0
  73. data/lib/mindee/product/international_id/international_id_v2_page.rb +32 -0
  74. data/lib/mindee/product/invoice/invoice_v4.rb +3 -1
  75. data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.rb +3 -1
  76. data/lib/mindee/product/passport/passport_v1.rb +3 -1
  77. data/lib/mindee/product/proof_of_address/proof_of_address_v1.rb +3 -1
  78. data/lib/mindee/product/receipt/receipt_v5.rb +3 -1
  79. data/lib/mindee/product/resume/resume_v1.rb +39 -0
  80. data/lib/mindee/product/resume/resume_v1_certificate.rb +69 -0
  81. data/lib/mindee/product/resume/resume_v1_document.rb +322 -0
  82. data/lib/mindee/product/resume/resume_v1_education.rb +90 -0
  83. data/lib/mindee/product/resume/resume_v1_language.rb +55 -0
  84. data/lib/mindee/product/resume/resume_v1_page.rb +32 -0
  85. data/lib/mindee/product/resume/resume_v1_professional_experience.rb +97 -0
  86. data/lib/mindee/product/resume/resume_v1_social_networks_url.rb +55 -0
  87. data/lib/mindee/product/us/bank_check/bank_check_v1.rb +3 -1
  88. data/lib/mindee/product/us/driver_license/driver_license_v1.rb +3 -1
  89. data/lib/mindee/product/us/w9/w9_v1.rb +3 -1
  90. data/lib/mindee/product.rb +6 -0
  91. data/lib/mindee/version.rb +1 -1
  92. data/lib/mindee.rb +4 -0
  93. metadata +41 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe1aef5bf5c30b3b599d426140de05074840a57f29800129359d647e7ee1bbd5
4
- data.tar.gz: 43c93a85a9a6d65fcba85345d1410844b07b5ca7d49a8a8f2487ccd5adcf767f
3
+ metadata.gz: 28d1e6c48c575030a3c6519080f7cff23b52745c212d8db9cc43f8c800c1c3d8
4
+ data.tar.gz: a96015beeeac1378f72f77bd3bcb73c3032e0946e39cc7a4519b5db3eca3e8c4
5
5
  SHA512:
6
- metadata.gz: eff5e3f90cb351664059c4d6dcf78b839dca0e463d0d09b1b4b15a963828355c372845b0806369c21d6b46ed3b2ce45fd199e0bf7aa4c874df3fc06cae569d22
7
- data.tar.gz: cb724d0b07bc0a4729d288076b26221fb99fc74d146d181bdae578b95fa9a374ae7deb43e3bb8cadbf7a8d3e5d9e98ea6737c7917565e375668d1fc4e93f95e3
6
+ metadata.gz: 2ca08ce6349eb1ebeaf7cf2bbba6004ff638cfc0db480d7b41bf183f6f6a4066bd1a76a36edbf4282eb65f31c89487cad388cc1f2ea6bfa2bb6bed7ff6c6e517
7
+ data.tar.gz: e18f1c1f8190c73987b036745fba0e6dca91b98ee71bc6144d8f1612be4c497cbb5f0301951b91db494c4812ca07ef6ec86fdeee17bdb3e83aacaef481b2fb3f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Mindee Ruby API Library Changelog
2
2
 
3
+ ## v3.6.0 - 2024-02-21
4
+ ### Changes
5
+ * :sparkles: add support for resume V1
6
+
7
+
8
+ ## v3.5.0 - 2024-02-16
9
+ ### Changes
10
+ * :sparkles: add support for Generated V1 API
11
+ * :recycle: documents now aren't automatically converted to b64 when enqueued as non-PDF files
12
+ * :recycle: increase max async delay to 60 tries
13
+ * :sparkles: add support for FR bank statements
14
+ * :sparkles: add support for International ID V2
15
+ * :sparkles: add support for EU Driver License V1
16
+ * :recycle: update existing products
17
+ * :arrow_up: upgrade test lib
18
+
19
+ ### Fixes
20
+ * :memo: add missing default async sample code
21
+ * :bug: fix rst display issues
22
+ * :bug: fix display issues for single page models
23
+ * :bug: fix miscellaneous issues related to data display (no changes expected on existing models)
24
+ * :bug: fix CLI breaking for custom products
25
+ * :bug: fix encoding issue that prevented UNICODE file names from being properly sent to the server
26
+
27
+
3
28
  ## v3.4.0 - 2024-01-30
4
29
  ### Changes
5
30
  * :arrow_up: update invoices to v4.4
data/README.md CHANGED
@@ -135,13 +135,18 @@ customize the experience.
135
135
 
136
136
  * [Ruby Overview](https://developers.mindee.com/docs/getting-started-ocr-ruby)
137
137
  * [Custom OCR Ruby](https://developers.mindee.com/docs/api-builder-ocr-ruby)
138
+ * [Generated API Ruby](https://developers.mindee.com/docs/generated-api-ruby)
138
139
  * [Invoice OCR Ruby](https://developers.mindee.com/docs/invoice-ocr-ruby)
140
+ * [International Id OCR Ruby](https://developers.mindee.com/docs/international-id-ocr-ruby)
139
141
  * [Financial Document OCR Ruby](https://developers.mindee.com/docs/financial-document-ocr-ruby)
140
142
  * [Passport OCR Ruby](https://developers.mindee.com/docs/passport-ocr-ruby)
141
143
  * [Proof of Address OCR Ruby](https://developers.mindee.com/docs/proof-of-address-ocr-ruby)
142
144
  * [Receipt OCR Ruby](https://developers.mindee.com/docs/receipt-ocr-ruby)
145
+ * [Resume OCR Ruby](https://developers.mindee.com/docs/resume-ocr-ruby)
143
146
  * [EU License Plate OCR Ruby](https://developers.mindee.com/docs/eu-license-plate-ocr-ruby)
147
+ * [EU Driver License OCR Ruby](https://developers.mindee.com/docs/eu-driver-license-ocr-ruby)
144
148
  * [FR Bank Account Details OCR Ruby](https://developers.mindee.com/docs/fr-bank-account-details-ocr-ruby)
149
+ * [FR Bank Statement OCR Ruby](https://developers.mindee.com/docs/fr-bank-statement-ocr-ruby)
145
150
  * [FR Carte Vitale OCR Ruby](https://developers.mindee.com/docs/fr-carte-vitale-ocr-ruby)
146
151
  * [FR ID Card OCR Ruby](https://developers.mindee.com/docs/fr-id-card-ocr-ruby)
147
152
  * [US Bank Check OCR Ruby](https://developers.mindee.com/docs/us-bank-check-ocr-ruby)
@@ -163,4 +168,4 @@ Copyright © Mindee, SA
163
168
  Available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
164
169
 
165
170
  ## Questions?
166
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
171
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
data/bin/mindee.rb CHANGED
@@ -5,6 +5,7 @@ require 'bundler/setup'
5
5
  require 'optparse'
6
6
  require 'mindee'
7
7
 
8
+ options = {}
8
9
  DOCUMENTS = {
9
10
  "custom" => {
10
11
  description: "Custom document type from API builder",
@@ -12,6 +13,12 @@ DOCUMENTS = {
12
13
  sync: true,
13
14
  async: false,
14
15
  },
16
+ "generated" => {
17
+ description: "Generated document type from API builder",
18
+ doc_class: Mindee::Product::Generated::GeneratedV1,
19
+ sync: true,
20
+ async: true,
21
+ },
15
22
  "proof-of-address" => {
16
23
  description: 'Proof of Address',
17
24
  doc_class: Mindee::Product::ProofOfAddress::ProofOfAddressV1,
@@ -36,12 +43,24 @@ DOCUMENTS = {
36
43
  sync: true,
37
44
  async: false,
38
45
  },
46
+ "international-id" => {
47
+ description: 'International Id',
48
+ doc_class: Mindee::Product::InternationalId::InternationalIdV2,
49
+ sync: false,
50
+ async: true,
51
+ },
39
52
  "receipt" => {
40
53
  description: "Expense Receipt",
41
54
  doc_class: Mindee::Product::Receipt::ReceiptV5,
42
55
  sync: true,
43
56
  async: false,
44
57
  },
58
+ "resume" => {
59
+ description: "Resume",
60
+ doc_class: Mindee::Product::Resume::ResumeV1,
61
+ sync: false,
62
+ async: true,
63
+ },
45
64
  "passport" => {
46
65
  description: "Passport",
47
66
  doc_class: Mindee::Product::Passport::PassportV1,
@@ -54,12 +73,24 @@ DOCUMENTS = {
54
73
  sync: true,
55
74
  async: false,
56
75
  },
76
+ "eu-driver-license" => {
77
+ description: "EU Driver License",
78
+ doc_class: Mindee::Product::EU::DriverLicense::DriverLicenseV1,
79
+ sync: true,
80
+ async: false,
81
+ },
57
82
  "fr-bank-account-details" => {
58
83
  description: "FR Bank Account Details",
59
84
  doc_class: Mindee::Product::FR::BankAccountDetails::BankAccountDetailsV2,
60
85
  sync: true,
61
86
  async: false,
62
87
  },
88
+ "fr-bank-statement" => {
89
+ description: "FR Bank Statement",
90
+ doc_class: Mindee::Product::FR::BankStatement::BankStatementV1,
91
+ sync: false,
92
+ async: true,
93
+ },
63
94
  "fr-carte-vitale" => {
64
95
  description: "FR Carte Vitale",
65
96
  doc_class: Mindee::Product::FR::CarteVitale::CarteVitaleV1,
@@ -105,11 +136,11 @@ DEFAULT_CUTTING = {
105
136
  on_min_pages: 0,
106
137
  }
107
138
 
108
- # Initializes custom-specific options
139
+ # Initializes custom & generated-specific options
109
140
  # @param cli_parser [OptionParser]
110
- def custom_subcommand(cli_parser)
141
+ def custom_subcommand(cli_parser, options)
111
142
  cli_parser.on('-v [VERSION]', '--version [VERSION]', 'Model version for the API') do |v|
112
- options[:version] = v
143
+ options[:endpoint_version] = v
113
144
  end
114
145
  cli_parser.on('-a ACCOUNT_NAME', '--account ACCOUNT_NAME', 'API account name for the endpoint') do |v|
115
146
  options[:account_name] = v
@@ -118,7 +149,7 @@ end
118
149
 
119
150
  product_parser = {}
120
151
  DOCUMENTS.each do |doc_key, doc_value|
121
- product_parser[doc_key] = OptionParser.new do | opts |
152
+ product_parser[doc_key] = OptionParser.new do |opts|
122
153
  opts.on('-w', '--all-words', 'Include words in response') do |v|
123
154
  options[:all_words] = v
124
155
  end
@@ -134,11 +165,11 @@ DOCUMENTS.each do |doc_key, doc_value|
134
165
  opts.on('-F', '--fix-pdf', "Attempts to fix broken PDF files before sending them to the server.") do |v|
135
166
  options[:fix_pdf] = true
136
167
  end
137
- if (doc_key != 'custom')
168
+ if (doc_key != 'custom' && doc_key != 'generated')
138
169
  opts.banner = "Product: #{doc_value[:description]}. \nUsage: mindee.rb #{doc_key} [options] file"
139
170
  else
140
- opts.banner = "#{doc_value[:description]}. \nUsage: mindee.rb custom [options] endpoint_name file"
141
- custom_subcommand(opts)
171
+ opts.banner = "#{doc_value[:description]}. \nUsage: \nmindee.rb custom [options] endpoint_name file\nor\nmindee.rb generated [options] endpoint_name file"
172
+ custom_subcommand(opts, options)
142
173
  end
143
174
  if doc_value[:async]
144
175
  if doc_value[:sync]
@@ -150,7 +181,7 @@ DOCUMENTS.each do |doc_key, doc_value|
150
181
  end
151
182
  end
152
183
 
153
- global_parser = OptionParser.new do | opts |
184
+ global_parser = OptionParser.new do |opts|
154
185
  opts.banner = "Usage: mindee.rb product [options] file"
155
186
  opts.separator "Available products:"
156
187
  opts.separator " #{DOCUMENTS.keys.join("\n ")}"
@@ -163,9 +194,9 @@ end
163
194
  doc_class = DOCUMENTS[command][:doc_class]
164
195
  product_parser[command].parse!
165
196
 
166
- if command == 'custom'
197
+ if command == 'custom' || command == 'generated'
167
198
  if ARGV.length < 2
168
- $stderr.puts "The 'custom' command requires both ENDPOINT_NAME and file arguments."
199
+ $stderr.puts "The '#{command}' command requires both ENDPOINT_NAME and file arguments."
169
200
  abort(product_parser[command].help)
170
201
  end
171
202
  endpoint_name = ARGV[0]
@@ -186,12 +217,11 @@ else
186
217
  input_source = mindee_client.source_from_path(options[:file_path], fix_pdf: options[:fix_pdf])
187
218
  end
188
219
 
189
- if command == 'custom'
190
- endpoint_name = 'endpoint_name'
220
+ if command == 'custom' || command == 'generated'
191
221
  custom_endpoint = mindee_client.create_endpoint(
192
- account_name: endpoint_name,
193
- endpoint_name: options[:account_name],
194
- endpoint_version: options[:endpoint_version].nil? ? "1" : options[:endpoint_version]
222
+ endpoint_name: endpoint_name,
223
+ account_name: options[:account_name],
224
+ version: options[:endpoint_version].nil? ? "1" : options[:endpoint_version]
195
225
  )
196
226
  else
197
227
  custom_endpoint = nil
@@ -134,4 +134,4 @@ puts result.document.inference.prediction.swift_code.value
134
134
  ```
135
135
 
136
136
  # Questions?
137
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
137
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -179,4 +179,4 @@ end
179
179
  ```
180
180
 
181
181
  # Questions?
182
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
182
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -0,0 +1,175 @@
1
+ ---
2
+ title: FR Bank Statement (FR) OCR Ruby
3
+ ---
4
+ The Ruby OCR SDK supports the [Bank Statement (FR) API](https://platform.mindee.com/mindee/bank_statement_fr).
5
+
6
+ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bank_statement_fr/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
7
+ ![Bank Statement (FR) sample](https://github.com/mindee/client-lib-test-data/blob/main/products/bank_statement_fr/default_sample.jpg?raw=true)
8
+
9
+ # Quick-Start
10
+ ```rb
11
+ require 'mindee'
12
+
13
+ # Init a new client
14
+ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
15
+
16
+ # Load a file from disk
17
+ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
18
+
19
+ # Parse the file
20
+ result = mindee_client.enqueue_and_parse(
21
+ input_source,
22
+ Mindee::Product::FR::BankStatement::BankStatementV1
23
+ )
24
+
25
+ # Print a full summary of the parsed data in RST format
26
+ puts result.document
27
+
28
+ # Print the document-level parsed data
29
+ # puts result.document.inference.prediction
30
+ ```
31
+
32
+ **Output (RST):**
33
+ ```rst
34
+ ```
35
+
36
+ # Field Types
37
+ ## Standard Fields
38
+ These fields are generic and used in several products.
39
+
40
+ ### Basic Field
41
+ Each prediction object contains a set of fields that inherit from the generic `Field` class.
42
+ A typical `Field` object will have the following attributes:
43
+
44
+ * **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
45
+ * **confidence** (Float, nil): the confidence score of the field prediction.
46
+ * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
47
+ * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
48
+ * **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
49
+ * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
50
+
51
+
52
+ Aside from the previous attributes, all basic fields have access to a `to_s` method that can be used to print their value as a string.
53
+
54
+
55
+ ### Amount Field
56
+ The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`).
57
+
58
+ ### Date Field
59
+ Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
60
+
61
+ * **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
62
+
63
+ ### String Field
64
+ The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
65
+
66
+ ## Specific Fields
67
+ Fields which are specific to this product; they are not used in any other product.
68
+
69
+ ### Transactions Field
70
+ The list of values that represent the financial transactions recorded in a bank statement.
71
+
72
+ A `BankStatementV1Transaction` implements the following attributes:
73
+
74
+ * `amount` (Float): The monetary amount of the transaction.
75
+ * `date` (String): The date on which the transaction occurred.
76
+ * `description` (String): The additional information about the transaction.
77
+
78
+ # Attributes
79
+ The following fields are extracted for Bank Statement (FR) V1:
80
+
81
+ ## Account Number
82
+ **account_number** ([StringField](#string-field)): The unique identifier for a customer's account in the bank's system.
83
+
84
+ ```rb
85
+ puts result.document.inference.prediction.account_number.value
86
+ ```
87
+
88
+ ## Bank Address
89
+ **bank_address** ([StringField](#string-field)): The physical location of the bank where the statement was issued.
90
+
91
+ ```rb
92
+ puts result.document.inference.prediction.bank_address.value
93
+ ```
94
+
95
+ ## Bank Name
96
+ **bank_name** ([StringField](#string-field)): The name of the bank that issued the statement.
97
+
98
+ ```rb
99
+ puts result.document.inference.prediction.bank_name.value
100
+ ```
101
+
102
+ ## Client Address
103
+ **client_address** ([StringField](#string-field)): The address of the client associated with the bank statement.
104
+
105
+ ```rb
106
+ puts result.document.inference.prediction.client_address.value
107
+ ```
108
+
109
+ ## Client Name
110
+ **client_name** ([StringField](#string-field)): The name of the client who owns the bank statement.
111
+
112
+ ```rb
113
+ puts result.document.inference.prediction.client_name.value
114
+ ```
115
+
116
+ ## Closing Balance
117
+ **closing_balance** ([AmountField](#amount-field)): The final amount of money in the account at the end of the statement period.
118
+
119
+ ```rb
120
+ puts result.document.inference.prediction.closing_balance.value
121
+ ```
122
+
123
+ ## Opening Balance
124
+ **opening_balance** ([AmountField](#amount-field)): The initial amount of money in an account at the start of the period.
125
+
126
+ ```rb
127
+ puts result.document.inference.prediction.opening_balance.value
128
+ ```
129
+
130
+ ## Statement Date
131
+ **statement_date** ([DateField](#date-field)): The date on which the bank statement was generated.
132
+
133
+ ```rb
134
+ puts result.document.inference.prediction.statement_date.value
135
+ ```
136
+
137
+ ## Statement End Date
138
+ **statement_end_date** ([DateField](#date-field)): The date when the statement period ends.
139
+
140
+ ```rb
141
+ puts result.document.inference.prediction.statement_end_date.value
142
+ ```
143
+
144
+ ## Statement Start Date
145
+ **statement_start_date** ([DateField](#date-field)): The date when the bank statement period begins.
146
+
147
+ ```rb
148
+ puts result.document.inference.prediction.statement_start_date.value
149
+ ```
150
+
151
+ ## Total Credits
152
+ **total_credits** ([AmountField](#amount-field)): The total amount of money deposited into the account.
153
+
154
+ ```rb
155
+ puts result.document.inference.prediction.total_credits.value
156
+ ```
157
+
158
+ ## Total Debits
159
+ **total_debits** ([AmountField](#amount-field)): The total amount of money debited from the account.
160
+
161
+ ```rb
162
+ puts result.document.inference.prediction.total_debits.value
163
+ ```
164
+
165
+ ## Transactions
166
+ **transactions** (Array<[BankStatementV1Transaction](#transactions-field)>): The list of values that represent the financial transactions recorded in a bank statement.
167
+
168
+ ```rb
169
+ for transactions_elem in result.document.inference.prediction.transactions do
170
+ puts transactions_elem.value
171
+ end
172
+ ```
173
+
174
+ # Questions?
175
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -101,4 +101,4 @@ end
101
101
  ```
102
102
 
103
103
  # Questions?
104
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
104
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -34,12 +34,12 @@ puts result.document
34
34
  ########
35
35
  Document
36
36
  ########
37
- :Mindee ID: f0e0f7a9-0f44-4a3d-92c7-5be262133d33
37
+ :Mindee ID: 4443182b-57c1-4426-a288-01b94f226e84
38
38
  :Filename: default_sample.jpg
39
39
 
40
40
  Inference
41
41
  #########
42
- :Product: mindee/carte_grise v1.0
42
+ :Product: mindee/carte_grise v1.1
43
43
  :Rotation applied: Yes
44
44
 
45
45
  Prediction
@@ -67,14 +67,14 @@ Prediction
67
67
  :p2: 90
68
68
  :p3: GO
69
69
  :p6: 6
70
- :q:
70
+ :q: 006
71
71
  :s1: 5
72
72
  :s2:
73
73
  :u1: 77
74
74
  :u2: 3000
75
75
  :v7: 155
76
76
  :x1: 2011-07-06
77
- :y1:
77
+ :y1: 17835
78
78
  :y2:
79
79
  :y3: 0
80
80
  :y4: 4
@@ -451,4 +451,4 @@ puts result.document.inference.prediction.y6.value
451
451
  ```
452
452
 
453
453
  # Questions?
454
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
454
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -120,4 +120,4 @@ puts result.document.inference.prediction.surname.value
120
120
  ```
121
121
 
122
122
  # Questions?
123
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
123
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -0,0 +1,19 @@
1
+ require 'mindee'
2
+
3
+ # Init a new client
4
+ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
5
+
6
+ # Load a file from disk
7
+ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
8
+
9
+ # Parse the file
10
+ result = mindee_client.enqueue_and_parse(
11
+ input_source,
12
+ Mindee::Product::FR::BankStatement::BankStatementV1
13
+ )
14
+
15
+ # Print a full summary of the parsed data in RST format
16
+ puts result.document
17
+
18
+ # Print the document-level parsed data
19
+ # puts result.document.inference.prediction
@@ -1,24 +1,24 @@
1
- require 'uri'
2
- require 'net/http'
3
- require 'net/https'
1
+ require 'mindee'
4
2
 
5
- api_key = "my-api-key"
6
- account = "my-account"
7
- endpoint = "my-endpoint"
8
- version = "my-version"
3
+ # Init a new client
4
+ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
9
5
 
10
- url = URI("https://api.mindee.net/v1/products/#{account}/#{endpoint}/v#{version}/predict")
11
- file = '/path/to/the/file.ext'
6
+ # Load a file from disk
7
+ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
12
8
 
13
- http = Net::HTTP.new(url.host, url.port)
14
- http.use_ssl = true
9
+ # Initialize a custom endpoint for this product
10
+ custom_endpoint = mindee_client.create_endpoint(
11
+ account_name: 'my-account',
12
+ endpoint_name: 'my-endpoint',
13
+ version: 'my-version'
14
+ )
15
15
 
16
- request = Net::HTTP::Post.new(url)
17
- request['Authorization'] = "Token #{api_key}"
18
- request.set_form([['document', File.open(file)]], 'multipart/form-data')
16
+ # Parse the file
17
+ result = mindee_client.parse(
18
+ input_source,
19
+ Mindee::Product::Generated::GeneratedV1,
20
+ endpoint: custom_endpoint
21
+ )
19
22
 
20
- response = http.request(request)
21
- if !response.kind_of? Net::HTTPSuccess
22
- raise response.msg
23
- end
24
- puts response.read_body
23
+ # Print a full summary of the parsed data in RST format
24
+ puts result.document
@@ -0,0 +1,25 @@
1
+ require 'mindee'
2
+
3
+ # Init a new client
4
+ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
5
+
6
+ # Load a file from disk
7
+ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
8
+
9
+ # Initialize a custom endpoint for this product
10
+ custom_endpoint = mindee_client.create_endpoint(
11
+ account_name: 'my-account',
12
+ endpoint_name: 'my-endpoint',
13
+ version: 'my-version'
14
+ )
15
+
16
+ # Parse the file
17
+ result = mindee_client.enqueue_and_parse(
18
+ input_source,
19
+ Mindee::Product::Generated::GeneratedV1,
20
+ endpoint: custom_endpoint
21
+ )
22
+
23
+ # Print a full summary of the parsed data in RST format
24
+ puts result.document
25
+
@@ -0,0 +1,19 @@
1
+ require 'mindee'
2
+
3
+ # Init a new client
4
+ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
5
+
6
+ # Load a file from disk
7
+ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
8
+
9
+ # Parse the file
10
+ result = mindee_client.parse(
11
+ input_source,
12
+ Mindee::Product::EU::DriverLicense::DriverLicenseV1
13
+ )
14
+
15
+ # Print a full summary of the parsed data in RST format
16
+ puts result.document
17
+
18
+ # Print the document-level parsed data
19
+ # puts result.document.inference.prediction
@@ -0,0 +1,19 @@
1
+ require 'mindee'
2
+
3
+ # Init a new client
4
+ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
5
+
6
+ # Load a file from disk
7
+ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
8
+
9
+ # Parse the file
10
+ result = mindee_client.enqueue_and_parse(
11
+ input_source,
12
+ Mindee::Product::InternationalId::InternationalIdV1
13
+ )
14
+
15
+ # Print a full summary of the parsed data in RST format
16
+ puts result.document
17
+
18
+ # Print the document-level parsed data
19
+ # puts result.document.inference.prediction
@@ -0,0 +1,19 @@
1
+ require 'mindee'
2
+
3
+ # Init a new client
4
+ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
5
+
6
+ # Load a file from disk
7
+ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
8
+
9
+ # Parse the file
10
+ result = mindee_client.enqueue_and_parse(
11
+ input_source,
12
+ Mindee::Product::InternationalId::InternationalIdV2
13
+ )
14
+
15
+ # Print a full summary of the parsed data in RST format
16
+ puts result.document
17
+
18
+ # Print the document-level parsed data
19
+ # puts result.document.inference.prediction
@@ -0,0 +1,19 @@
1
+ require 'mindee'
2
+
3
+ # Init a new client
4
+ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
5
+
6
+ # Load a file from disk
7
+ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
8
+
9
+ # Parse the file
10
+ result = mindee_client.enqueue_and_parse(
11
+ input_source,
12
+ Mindee::Product::Resume::ResumeV1
13
+ )
14
+
15
+ # Print a full summary of the parsed data in RST format
16
+ puts result.document
17
+
18
+ # Print the document-level parsed data
19
+ # puts result.document.inference.prediction
data/docs/cropper_v1.md CHANGED
@@ -97,4 +97,4 @@ end
97
97
  ```
98
98
 
99
99
  # Questions?
100
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
100
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
data/docs/custom_v1.md CHANGED
@@ -106,4 +106,4 @@ console.log(result.document.inference.prediction.classifications["my-classificat
106
106
 
107
107
  # Questions?
108
108
 
109
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
109
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)