mindee 3.8.0 → 3.9.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 +1 -1
- data/CHANGELOG.md +5 -0
- data/docs/expense_receipts_v5.md +7 -0
- data/docs/financial_document_v1.md +15 -1
- data/lib/mindee/product/financial_document/financial_document_v1_document.rb +12 -2
- data/lib/mindee/product/financial_document/financial_document_v1_page.rb +1 -1
- data/lib/mindee/product/receipt/receipt_v5_document.rb +6 -1
- data/lib/mindee/product/receipt/receipt_v5_page.rb +1 -1
- data/lib/mindee/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a863bb97566add59f1d2385e9688cab9841a3c4b22228138dd72023ad0521fc
|
4
|
+
data.tar.gz: ff3097cb84eba1ceef71f229a1b6f0152ba2a5659b5b9955dae313046eacfc39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26c78e63b0464261718d20718628d30df2f1b805c55e9d0d87670abfc4d97e7f0b0fdcab21c8e7810cffe0562923dde6a551fb59a8a8d393c535e89e7ed12d3c
|
7
|
+
data.tar.gz: dd333f2e4169061884be3bc39649862fab3fdcfc2bc9039f0b850cc2e5690194fa5915917dcaeb5d622b0df444bf8a8e81647ea9edc6b940c94324c37aefa7d6
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/docs/expense_receipts_v5.md
CHANGED
@@ -221,6 +221,13 @@ end
|
|
221
221
|
puts result.document.inference.prediction.locale.value
|
222
222
|
```
|
223
223
|
|
224
|
+
## Receipt Number
|
225
|
+
**receipt_number** ([StringField](#string-field)): The receipt number or identifier.
|
226
|
+
|
227
|
+
```rb
|
228
|
+
puts result.document.inference.prediction.receipt_number.value
|
229
|
+
```
|
230
|
+
|
224
231
|
## Purchase Subcategory
|
225
232
|
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory among predefined classes for transport and food.
|
226
233
|
|
@@ -276,6 +276,13 @@ puts result.document.inference.prediction.customer_name.value
|
|
276
276
|
puts result.document.inference.prediction.date.value
|
277
277
|
```
|
278
278
|
|
279
|
+
## Document Number
|
280
|
+
**document_number** ([StringField](#string-field)): The document number or identifier.
|
281
|
+
|
282
|
+
```rb
|
283
|
+
puts result.document.inference.prediction.document_number.value
|
284
|
+
```
|
285
|
+
|
279
286
|
## Document Type
|
280
287
|
**document_type** ([ClassificationField](#classification-field)): One of: 'INVOICE', 'CREDIT NOTE', 'CREDIT CARD RECEIPT', 'EXPENSE RECEIPT'.
|
281
288
|
|
@@ -291,7 +298,7 @@ puts result.document.inference.prediction.due_date.value
|
|
291
298
|
```
|
292
299
|
|
293
300
|
## Invoice Number
|
294
|
-
**invoice_number** ([StringField](#string-field)): The invoice number or identifier.
|
301
|
+
**invoice_number** ([StringField](#string-field)): The invoice number or identifier only if document is an invoice.
|
295
302
|
|
296
303
|
```rb
|
297
304
|
puts result.document.inference.prediction.invoice_number.value
|
@@ -313,6 +320,13 @@ end
|
|
313
320
|
puts result.document.inference.prediction.locale.value
|
314
321
|
```
|
315
322
|
|
323
|
+
## Receipt Number
|
324
|
+
**receipt_number** ([StringField](#string-field)): The receipt number or identifier only if document is a receipt.
|
325
|
+
|
326
|
+
```rb
|
327
|
+
puts result.document.inference.prediction.receipt_number.value
|
328
|
+
```
|
329
|
+
|
316
330
|
## Reference Numbers
|
317
331
|
**reference_numbers** (Array<[StringField](#string-field)>): List of Reference numbers, including PO number.
|
318
332
|
|
@@ -6,7 +6,7 @@ require_relative 'financial_document_v1_line_item'
|
|
6
6
|
module Mindee
|
7
7
|
module Product
|
8
8
|
module FinancialDocument
|
9
|
-
# Financial Document API version 1.
|
9
|
+
# Financial Document API version 1.7 document data.
|
10
10
|
class FinancialDocumentV1Document < Mindee::Parsing::Common::Prediction
|
11
11
|
include Mindee::Parsing::Standard
|
12
12
|
# The customer's address used for billing.
|
@@ -30,13 +30,16 @@ module Mindee
|
|
30
30
|
# The date the purchase was made.
|
31
31
|
# @return [Mindee::Parsing::Standard::DateField]
|
32
32
|
attr_reader :date
|
33
|
+
# The document number or identifier.
|
34
|
+
# @return [Mindee::Parsing::Standard::StringField]
|
35
|
+
attr_reader :document_number
|
33
36
|
# One of: 'INVOICE', 'CREDIT NOTE', 'CREDIT CARD RECEIPT', 'EXPENSE RECEIPT'.
|
34
37
|
# @return [Mindee::Parsing::Standard::ClassificationField]
|
35
38
|
attr_reader :document_type
|
36
39
|
# The date on which the payment is due.
|
37
40
|
# @return [Mindee::Parsing::Standard::DateField]
|
38
41
|
attr_reader :due_date
|
39
|
-
# The invoice number or identifier.
|
42
|
+
# The invoice number or identifier only if document is an invoice.
|
40
43
|
# @return [Mindee::Parsing::Standard::StringField]
|
41
44
|
attr_reader :invoice_number
|
42
45
|
# List of line item details.
|
@@ -45,6 +48,9 @@ module Mindee
|
|
45
48
|
# The locale detected on the document.
|
46
49
|
# @return [Mindee::Parsing::Standard::LocaleField]
|
47
50
|
attr_reader :locale
|
51
|
+
# The receipt number or identifier only if document is a receipt.
|
52
|
+
# @return [Mindee::Parsing::Standard::StringField]
|
53
|
+
attr_reader :receipt_number
|
48
54
|
# List of Reference numbers, including PO number.
|
49
55
|
# @return [Array<Mindee::Parsing::Standard::StringField>]
|
50
56
|
attr_reader :reference_numbers
|
@@ -108,6 +114,7 @@ module Mindee
|
|
108
114
|
@customer_id = StringField.new(prediction['customer_id'], page_id)
|
109
115
|
@customer_name = StringField.new(prediction['customer_name'], page_id)
|
110
116
|
@date = DateField.new(prediction['date'], page_id)
|
117
|
+
@document_number = StringField.new(prediction['document_number'], page_id)
|
111
118
|
@document_type = ClassificationField.new(prediction['document_type'], page_id)
|
112
119
|
@due_date = DateField.new(prediction['due_date'], page_id)
|
113
120
|
@invoice_number = StringField.new(prediction['invoice_number'], page_id)
|
@@ -116,6 +123,7 @@ module Mindee
|
|
116
123
|
@line_items.push(FinancialDocumentV1LineItem.new(item, page_id))
|
117
124
|
end
|
118
125
|
@locale = LocaleField.new(prediction['locale'], page_id)
|
126
|
+
@receipt_number = StringField.new(prediction['receipt_number'], page_id)
|
119
127
|
@reference_numbers = []
|
120
128
|
prediction['reference_numbers'].each do |item|
|
121
129
|
@reference_numbers.push(StringField.new(item, page_id))
|
@@ -153,6 +161,8 @@ module Mindee
|
|
153
161
|
out_str = String.new
|
154
162
|
out_str << "\n:Locale: #{@locale}".rstrip
|
155
163
|
out_str << "\n:Invoice Number: #{@invoice_number}".rstrip
|
164
|
+
out_str << "\n:Receipt Number: #{@receipt_number}".rstrip
|
165
|
+
out_str << "\n:Document Number: #{@document_number}".rstrip
|
156
166
|
out_str << "\n:Reference Numbers: #{reference_numbers}".rstrip
|
157
167
|
out_str << "\n:Purchase Date: #{@date}".rstrip
|
158
168
|
out_str << "\n:Due Date: #{@due_date}".rstrip
|
@@ -6,7 +6,7 @@ require_relative 'financial_document_v1_document'
|
|
6
6
|
module Mindee
|
7
7
|
module Product
|
8
8
|
module FinancialDocument
|
9
|
-
# Financial Document API version 1.
|
9
|
+
# Financial Document API version 1.7 page data.
|
10
10
|
class FinancialDocumentV1Page < Mindee::Parsing::Common::Page
|
11
11
|
# @param prediction [Hash]
|
12
12
|
def initialize(prediction)
|
@@ -6,7 +6,7 @@ require_relative 'receipt_v5_line_item'
|
|
6
6
|
module Mindee
|
7
7
|
module Product
|
8
8
|
module Receipt
|
9
|
-
# Receipt API version 5.
|
9
|
+
# Receipt API version 5.2 document data.
|
10
10
|
class ReceiptV5Document < Mindee::Parsing::Common::Prediction
|
11
11
|
include Mindee::Parsing::Standard
|
12
12
|
# The purchase category among predefined classes.
|
@@ -24,6 +24,9 @@ module Mindee
|
|
24
24
|
# The locale detected on the document.
|
25
25
|
# @return [Mindee::Parsing::Standard::LocaleField]
|
26
26
|
attr_reader :locale
|
27
|
+
# The receipt number or identifier.
|
28
|
+
# @return [Mindee::Parsing::Standard::StringField]
|
29
|
+
attr_reader :receipt_number
|
27
30
|
# The purchase subcategory among predefined classes for transport and food.
|
28
31
|
# @return [Mindee::Parsing::Standard::ClassificationField]
|
29
32
|
attr_reader :subcategory
|
@@ -70,6 +73,7 @@ module Mindee
|
|
70
73
|
@line_items.push(ReceiptV5LineItem.new(item, page_id))
|
71
74
|
end
|
72
75
|
@locale = LocaleField.new(prediction['locale'], page_id)
|
76
|
+
@receipt_number = StringField.new(prediction['receipt_number'], page_id)
|
73
77
|
@subcategory = ClassificationField.new(prediction['subcategory'], page_id)
|
74
78
|
@supplier_address = StringField.new(prediction['supplier_address'], page_id)
|
75
79
|
@supplier_company_registrations = []
|
@@ -106,6 +110,7 @@ module Mindee
|
|
106
110
|
out_str << "\n:Supplier Company Registrations: #{supplier_company_registrations}".rstrip
|
107
111
|
out_str << "\n:Supplier Address: #{@supplier_address}".rstrip
|
108
112
|
out_str << "\n:Supplier Phone Number: #{@supplier_phone_number}".rstrip
|
113
|
+
out_str << "\n:Receipt Number: #{@receipt_number}".rstrip
|
109
114
|
out_str << "\n:Line Items:"
|
110
115
|
out_str << line_items
|
111
116
|
out_str[1..].to_s
|
@@ -6,7 +6,7 @@ require_relative 'receipt_v5_document'
|
|
6
6
|
module Mindee
|
7
7
|
module Product
|
8
8
|
module Receipt
|
9
|
-
# Receipt API version 5.
|
9
|
+
# Receipt API version 5.2 page data.
|
10
10
|
class ReceiptV5Page < Mindee::Parsing::Common::Page
|
11
11
|
# @param prediction [Hash]
|
12
12
|
def initialize(prediction)
|
data/lib/mindee/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mindee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindee, SA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: marcel
|