veryfi 0.0.0 → 0.1.3
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/.github/workflows/release.yml +26 -0
- data/.github/workflows/test.yml +22 -0
- data/.rubocop.yml +24 -0
- data/Gemfile.lock +56 -39
- data/README.md +57 -45
- data/bin/release +12 -0
- data/coverage/coverage-badge.png +0 -0
- data/docs/.gitignore +5 -0
- data/docs/404.html +25 -0
- data/docs/Gemfile +30 -0
- data/docs/Gemfile.lock +282 -0
- data/docs/_config.yml +50 -0
- data/docs/_includes/footer.html +35 -0
- data/docs/_includes/header.html +30 -0
- data/docs/index.markdown +273 -0
- data/lib/veryfi/api/document.rb +60 -1
- data/lib/veryfi/api/document_tag.rb +31 -0
- data/lib/veryfi/api/line_item.rb +35 -0
- data/lib/veryfi/api/tag.rb +23 -0
- data/lib/veryfi/client.rb +13 -19
- data/lib/veryfi/error.rb +45 -0
- data/lib/veryfi/request.rb +51 -8
- data/lib/veryfi/signature.rb +2 -2
- data/lib/veryfi/version.rb +1 -1
- data/lib/veryfi.rb +4 -0
- data/veryfi.gemspec +7 -3
- metadata +68 -11
- data/bin/build +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fa063aa14b6a540ea48bd02a484b211e5acc7e11bb4aaf59068f59e983f69ed5
|
|
4
|
+
data.tar.gz: 754e3dec09c3beb49939c34f133b24a27f3d45cf89d6adcf44601cb12e46a46c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0869e3e754ce266a002f6d995b62102f94140b4203316f16b5436979a35b53eea42f18fdda25c978a3c213c7e4f131ce869c494b652bf18272b74b651429d07d'
|
|
7
|
+
data.tar.gz: 1428c37fdf6b6ca08dcd62d6aef36c6888297584caf0979b5e5650c5b25a5abde4bd8288e2122ca8cd9f902745ef27632309e0ef216407cf3b15290f19abeb08
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v2
|
|
14
|
+
- name: Set up Ruby
|
|
15
|
+
uses: ruby/setup-ruby@v1
|
|
16
|
+
with:
|
|
17
|
+
ruby-version: 2.7
|
|
18
|
+
# runs 'bundle install' and caches installed gems automatically
|
|
19
|
+
bundler-cache: true
|
|
20
|
+
- name: Release Gem
|
|
21
|
+
uses: discourse/publish-rubygems-action@v2-beta
|
|
22
|
+
env:
|
|
23
|
+
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
|
24
|
+
RELEASE_COMMAND: bin/release
|
|
25
|
+
GIT_EMAIL: support@veryfi.com
|
|
26
|
+
GIT_NAME: Github Action
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
strategy:
|
|
9
|
+
matrix:
|
|
10
|
+
ruby_version: [2.6, 2.7]
|
|
11
|
+
env:
|
|
12
|
+
CI: true
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v2
|
|
15
|
+
- name: Set up Ruby
|
|
16
|
+
uses: ruby/setup-ruby@v1
|
|
17
|
+
with:
|
|
18
|
+
ruby-version: ${{ matrix.ruby_version }}
|
|
19
|
+
# runs 'bundle install' and caches installed gems automatically
|
|
20
|
+
bundler-cache: true
|
|
21
|
+
- name: Run CI scripts
|
|
22
|
+
run: bin/ci
|
data/.rubocop.yml
CHANGED
|
@@ -2,10 +2,13 @@ require: rubocop-rspec
|
|
|
2
2
|
|
|
3
3
|
AllCops:
|
|
4
4
|
DisplayCopNames: true
|
|
5
|
+
NewCops: enable
|
|
5
6
|
Exclude:
|
|
6
7
|
- bin/**/*
|
|
7
8
|
- tmp/**/*
|
|
8
9
|
- .bundle/**/*
|
|
10
|
+
- vendor/**/*
|
|
11
|
+
- docs/**/*
|
|
9
12
|
- veryfi.gemspec
|
|
10
13
|
|
|
11
14
|
Style/Documentation:
|
|
@@ -22,6 +25,9 @@ Style/SymbolArray:
|
|
|
22
25
|
Description: 'Use %i or %I for arrays of symbols.'
|
|
23
26
|
Enabled: true
|
|
24
27
|
|
|
28
|
+
Style/StringConcatenation:
|
|
29
|
+
Enabled: false
|
|
30
|
+
|
|
25
31
|
Style/StringLiterals:
|
|
26
32
|
EnforcedStyle: double_quotes
|
|
27
33
|
|
|
@@ -60,6 +66,24 @@ Metrics/BlockLength:
|
|
|
60
66
|
Naming/MemoizedInstanceVariableName:
|
|
61
67
|
EnforcedStyleForLeadingUnderscores: required
|
|
62
68
|
|
|
69
|
+
RSpec/AnyInstance:
|
|
70
|
+
Enabled: false
|
|
71
|
+
|
|
72
|
+
RSpec/ExampleLength:
|
|
73
|
+
Max: 10
|
|
74
|
+
|
|
75
|
+
RSpec/DescribeClass:
|
|
76
|
+
Enabled: false
|
|
77
|
+
|
|
78
|
+
RSpec/MultipleExpectations:
|
|
79
|
+
Max: 5
|
|
80
|
+
|
|
81
|
+
RSpec/SharedExamples:
|
|
82
|
+
Enabled: false
|
|
83
|
+
|
|
84
|
+
Style/GuardClause:
|
|
85
|
+
Enabled: false
|
|
86
|
+
|
|
63
87
|
Style/HashEachMethods:
|
|
64
88
|
Enabled: true
|
|
65
89
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
veryfi (0.
|
|
4
|
+
veryfi (0.1.3)
|
|
5
|
+
base64 (~> 0.1)
|
|
5
6
|
faraday (~> 1.7)
|
|
6
7
|
openssl (~> 2.2)
|
|
7
8
|
|
|
@@ -10,14 +11,16 @@ GEM
|
|
|
10
11
|
specs:
|
|
11
12
|
addressable (2.8.0)
|
|
12
13
|
public_suffix (>= 2.0.2, < 5.0)
|
|
13
|
-
ast (2.4.
|
|
14
|
-
|
|
14
|
+
ast (2.4.2)
|
|
15
|
+
base64 (0.1.0)
|
|
16
|
+
bundler-audit (0.9.0)
|
|
15
17
|
bundler (>= 1.2.0, < 3)
|
|
16
|
-
thor (~> 0
|
|
18
|
+
thor (~> 1.0)
|
|
17
19
|
coderay (1.1.3)
|
|
18
20
|
crack (0.4.5)
|
|
19
21
|
rexml
|
|
20
|
-
diff-lcs (1.
|
|
22
|
+
diff-lcs (1.4.4)
|
|
23
|
+
docile (1.4.0)
|
|
21
24
|
faraday (1.7.1)
|
|
22
25
|
faraday-em_http (~> 1.0)
|
|
23
26
|
faraday-em_synchrony (~> 1.0)
|
|
@@ -38,49 +41,60 @@ GEM
|
|
|
38
41
|
faraday-patron (1.0.0)
|
|
39
42
|
faraday-rack (1.0.0)
|
|
40
43
|
hashdiff (1.0.1)
|
|
41
|
-
jaro_winkler (1.5.4)
|
|
42
44
|
method_source (1.0.0)
|
|
43
45
|
multipart-post (2.1.1)
|
|
44
46
|
openssl (2.2.0)
|
|
45
|
-
parallel (1.
|
|
46
|
-
parser (
|
|
47
|
-
ast (~> 2.4.
|
|
47
|
+
parallel (1.20.1)
|
|
48
|
+
parser (3.0.2.0)
|
|
49
|
+
ast (~> 2.4.1)
|
|
48
50
|
pry (0.14.1)
|
|
49
51
|
coderay (~> 1.1)
|
|
50
52
|
method_source (~> 1.0)
|
|
51
53
|
public_suffix (4.0.6)
|
|
52
54
|
rainbow (3.0.0)
|
|
53
55
|
rake (13.0.6)
|
|
56
|
+
regexp_parser (2.1.1)
|
|
54
57
|
rexml (3.2.5)
|
|
55
|
-
rspec (3.
|
|
56
|
-
rspec-core (~> 3.
|
|
57
|
-
rspec-expectations (~> 3.
|
|
58
|
-
rspec-mocks (~> 3.
|
|
59
|
-
rspec-core (3.
|
|
60
|
-
rspec-support (~> 3.
|
|
61
|
-
rspec-expectations (3.
|
|
58
|
+
rspec (3.10.0)
|
|
59
|
+
rspec-core (~> 3.10.0)
|
|
60
|
+
rspec-expectations (~> 3.10.0)
|
|
61
|
+
rspec-mocks (~> 3.10.0)
|
|
62
|
+
rspec-core (3.10.1)
|
|
63
|
+
rspec-support (~> 3.10.0)
|
|
64
|
+
rspec-expectations (3.10.1)
|
|
62
65
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
63
|
-
rspec-support (~> 3.
|
|
66
|
+
rspec-support (~> 3.10.0)
|
|
64
67
|
rspec-its (1.3.0)
|
|
65
68
|
rspec-core (>= 3.0.0)
|
|
66
69
|
rspec-expectations (>= 3.0.0)
|
|
67
|
-
rspec-mocks (3.
|
|
70
|
+
rspec-mocks (3.10.2)
|
|
68
71
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
69
|
-
rspec-support (~> 3.
|
|
70
|
-
rspec-support (3.
|
|
71
|
-
rubocop (0.
|
|
72
|
-
jaro_winkler (~> 1.5.1)
|
|
72
|
+
rspec-support (~> 3.10.0)
|
|
73
|
+
rspec-support (3.10.2)
|
|
74
|
+
rubocop (0.93.1)
|
|
73
75
|
parallel (~> 1.10)
|
|
74
|
-
parser (>= 2.7.
|
|
76
|
+
parser (>= 2.7.1.5)
|
|
75
77
|
rainbow (>= 2.2.2, < 4.0)
|
|
78
|
+
regexp_parser (>= 1.8)
|
|
76
79
|
rexml
|
|
80
|
+
rubocop-ast (>= 0.6.0)
|
|
77
81
|
ruby-progressbar (~> 1.7)
|
|
78
82
|
unicode-display_width (>= 1.4.0, < 2.0)
|
|
79
|
-
rubocop-
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
rubocop-ast (1.11.0)
|
|
84
|
+
parser (>= 3.0.1.1)
|
|
85
|
+
rubocop-rspec (1.44.1)
|
|
86
|
+
rubocop (~> 0.87)
|
|
87
|
+
rubocop-ast (>= 0.7.1)
|
|
88
|
+
ruby-progressbar (1.11.0)
|
|
82
89
|
ruby2_keywords (0.0.5)
|
|
83
|
-
|
|
90
|
+
simplecov (0.21.2)
|
|
91
|
+
docile (~> 1.1)
|
|
92
|
+
simplecov-html (~> 0.11)
|
|
93
|
+
simplecov_json_formatter (~> 0.1)
|
|
94
|
+
simplecov-badge (2.0.2)
|
|
95
|
+
simplecov-html (0.12.3)
|
|
96
|
+
simplecov_json_formatter (0.1.3)
|
|
97
|
+
thor (1.1.0)
|
|
84
98
|
unicode-display_width (1.7.0)
|
|
85
99
|
vcr (6.0.0)
|
|
86
100
|
webmock (3.14.0)
|
|
@@ -89,20 +103,23 @@ GEM
|
|
|
89
103
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
90
104
|
|
|
91
105
|
PLATFORMS
|
|
92
|
-
|
|
106
|
+
x86_64-darwin-19
|
|
107
|
+
x86_64-linux
|
|
93
108
|
|
|
94
109
|
DEPENDENCIES
|
|
95
|
-
bundler
|
|
96
|
-
bundler-audit
|
|
97
|
-
pry
|
|
98
|
-
rake
|
|
99
|
-
rspec
|
|
100
|
-
rspec-its
|
|
101
|
-
rubocop
|
|
102
|
-
rubocop-rspec
|
|
103
|
-
|
|
110
|
+
bundler (~> 2.2)
|
|
111
|
+
bundler-audit (~> 0.9)
|
|
112
|
+
pry (~> 0.14)
|
|
113
|
+
rake (~> 13.0)
|
|
114
|
+
rspec (~> 3.9)
|
|
115
|
+
rspec-its (~> 1.3)
|
|
116
|
+
rubocop (~> 0.82)
|
|
117
|
+
rubocop-rspec (~> 1.38)
|
|
118
|
+
simplecov (~> 0.21)
|
|
119
|
+
simplecov-badge (~> 2.0)
|
|
120
|
+
vcr (~> 6.0)
|
|
104
121
|
veryfi!
|
|
105
|
-
webmock
|
|
122
|
+
webmock (~> 3.14)
|
|
106
123
|
|
|
107
124
|
BUNDLED WITH
|
|
108
|
-
|
|
125
|
+
2.2.26
|
data/README.md
CHANGED
|
@@ -2,51 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
+
[](https://rubygems.org/gems/veryfi)
|
|
6
|
+
[](https://github.com/veryfi/veryfi-ruby/actions/workflows/test.yml)
|
|
7
|
+
|
|
8
|
+
[](https://raw.githubusercontent.com/veryfi/veryfi-ruby/main/coverage/coverage-badge.png)
|
|
9
|
+
|
|
5
10
|
## Table of Contents
|
|
6
11
|
|
|
7
12
|
- [Veryfi SDK for Ruby](#veryfi-sdk-for-ruby)
|
|
8
13
|
- [Table of Contents](#table-of-contents)
|
|
14
|
+
- [Example](#example)
|
|
9
15
|
- [Installation](#installation)
|
|
10
16
|
- [Getting Started](#getting-started)
|
|
11
17
|
- [Obtaining Client ID and user keys](#obtaining-client-id-and-user-keys)
|
|
12
18
|
- [Ruby API Client Library](#ruby-api-client-library)
|
|
13
|
-
- [Extracting Data](#extracting-data)
|
|
14
|
-
- [Response](#response)
|
|
15
|
-
- [Updating a document](#updating-a-document)
|
|
16
19
|
- [Need help?](#need-help)
|
|
17
|
-
- [Learn more at our blog](#learn-more-at-our-blog)
|
|
18
|
-
- [Tutorial Video](#tutorial-video)
|
|
19
20
|
- [For Developers](#for-developers)
|
|
20
21
|
- [Install](#install)
|
|
21
22
|
- [Quality tools](#quality-tools)
|
|
22
23
|
- [Develop](#develop)
|
|
23
24
|
|
|
24
|
-
**veryfi** is a Ruby gem for communicating with the [Veryfi OCR API](https://veryfi.com/api/)
|
|
25
|
-
|
|
26
|
-
## Installation
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
gem install veryfi
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Or add to your Gemfile:
|
|
33
|
-
```ruby
|
|
34
|
-
gem 'veryfi'
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Getting Started
|
|
25
|
+
**veryfi-ruby** is a Ruby gem for communicating with the [Veryfi OCR API](https://veryfi.com/api/)
|
|
38
26
|
|
|
39
|
-
|
|
27
|
+
## Example
|
|
40
28
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
### Ruby API Client Library
|
|
44
|
-
|
|
45
|
-
The **veryfi** gem can be used to communicate with Veryfi API. All available functionality is described here: <https://veryfi.github.io/veryfi-ruby/Client.html>
|
|
46
|
-
|
|
47
|
-
Below is a sample script using **Veryfi** for OCR and extracting data from a document:
|
|
48
|
-
|
|
49
|
-
### Extracting Data
|
|
29
|
+
Below is a sample script using <a href="https://www.veryfi.com" target="_blank">**Veryfi**</a> for OCR and extracting data from a document:
|
|
50
30
|
|
|
51
31
|
```ruby
|
|
52
32
|
require 'veryfi'
|
|
@@ -57,15 +37,26 @@ veryfi_client = Veryfi::Client.new(
|
|
|
57
37
|
username: 'your_username',
|
|
58
38
|
api_key: 'your_password'
|
|
59
39
|
)
|
|
60
|
-
|
|
61
|
-
categories = ['Grocery', 'Utilities', 'Travel'];
|
|
62
|
-
file_path = './test/receipt.png';
|
|
63
40
|
```
|
|
64
41
|
|
|
65
42
|
This submits a document for processing (3-5 seconds for a response)
|
|
66
43
|
|
|
67
44
|
```ruby
|
|
68
|
-
|
|
45
|
+
params = {
|
|
46
|
+
file_path: './test/receipt.jpg',
|
|
47
|
+
auto_delete: true,
|
|
48
|
+
boost_mode: false,
|
|
49
|
+
async: false,
|
|
50
|
+
external_id: '123456789',
|
|
51
|
+
max_pages_to_process: 10,
|
|
52
|
+
tags: ['tag1'],
|
|
53
|
+
categories: [
|
|
54
|
+
'Advertising & Marketing',
|
|
55
|
+
'Automotive'
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
response = veryfi_client.document.process(params)
|
|
69
60
|
|
|
70
61
|
puts response
|
|
71
62
|
```
|
|
@@ -73,12 +64,26 @@ puts response
|
|
|
73
64
|
...or with a URL
|
|
74
65
|
|
|
75
66
|
```ruby
|
|
76
|
-
|
|
67
|
+
params = {
|
|
68
|
+
file_url: 'https://raw.githubusercontent.com/veryfi/veryfi-python/master/tests/assets/receipt_public.jpg',
|
|
69
|
+
auto_delete: true,
|
|
70
|
+
boost_mode: false,
|
|
71
|
+
async: false,
|
|
72
|
+
external_id: '123456789',
|
|
73
|
+
max_pages_to_process: 10,
|
|
74
|
+
tags: ['tag1'],
|
|
75
|
+
categories: [
|
|
76
|
+
'Advertising & Marketing',
|
|
77
|
+
'Automotive'
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
response = veryfi_client.document.process_url(params)
|
|
77
82
|
|
|
78
83
|
puts response
|
|
79
84
|
```
|
|
80
85
|
|
|
81
|
-
|
|
86
|
+
This will produce the following response:
|
|
82
87
|
|
|
83
88
|
```json
|
|
84
89
|
{
|
|
@@ -215,25 +220,32 @@ puts response
|
|
|
215
220
|
}
|
|
216
221
|
```
|
|
217
222
|
|
|
218
|
-
|
|
223
|
+
## Installation
|
|
219
224
|
|
|
225
|
+
```bash
|
|
226
|
+
gem install veryfi
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Or add to your Gemfile:
|
|
220
230
|
```ruby
|
|
231
|
+
gem 'veryfi', '~> 0.1'
|
|
221
232
|
```
|
|
222
233
|
|
|
223
|
-
##
|
|
234
|
+
## Getting Started
|
|
224
235
|
|
|
225
|
-
|
|
236
|
+
### Obtaining Client ID and user keys
|
|
226
237
|
|
|
227
|
-
If you
|
|
238
|
+
If you don't have an account with Veryfi, please go ahead and register here: [https://hub.veryfi.com/signup/api/](https://hub.veryfi.com/signup/api/)
|
|
228
239
|
|
|
229
|
-
###
|
|
240
|
+
### Ruby API Client Library
|
|
230
241
|
|
|
231
|
-
|
|
242
|
+
The **veryfi-ruby** gem can be used to communicate with Veryfi API. All available functionality is described [in docs](https://veryfi.github.io/veryfi-ruby/)
|
|
232
243
|
|
|
233
|
-
|
|
234
|
-
<!-- [![Veryfi Tutorial]()]() -->
|
|
244
|
+
## Need help?
|
|
235
245
|
|
|
236
|
-
|
|
246
|
+
If you run into any issue or need help installing or using the library, please contact support@veryfi.com.
|
|
247
|
+
|
|
248
|
+
If you found a bug in this library or would like new features added, then open an issue or pull requests against this repo!
|
|
237
249
|
|
|
238
250
|
# For Developers
|
|
239
251
|
|
|
@@ -250,4 +262,4 @@ bin/setup
|
|
|
250
262
|
|
|
251
263
|
## Develop
|
|
252
264
|
|
|
253
|
-
`bin/
|
|
265
|
+
`bin/ci` checks your specs and runs quality tools
|
data/bin/release
ADDED
|
Binary file
|