mindee 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.gitmodules +3 -0
- data/CHANGELOG.md +8 -0
- data/CONTRIBUTING.md +90 -0
- data/README.md +4 -2
- data/Rakefile +12 -2
- data/lib/mindee/documents/invoice.rb +1 -1
- data/lib/mindee/fields/custom_docs.rb +7 -0
- data/lib/mindee/inputs.rb +2 -2
- data/lib/mindee/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26a122535a224410e763068e0f0b18edeb88af4da890887e7ea846744be88dc6
|
4
|
+
data.tar.gz: ae80594004d03047bed56a285e74798b1afb855a70e58bbf14284bbc9d2ab8c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c1d7cfbdd6d2c28ceaa4259b2876585a4c84b3a7fddf6511f34880ed28606f5ff8e254de9294fe9a28f2db01673aac3c987c34a6df05c1dde3503117e7d849e
|
7
|
+
data.tar.gz: 8180cd2c300973141dc834c3184f86b9e2307e39362155c4a62b13b878679e4d3fcaedb85653161521ad42d9b5056e7378bba74f11e451f80468976ea193d915
|
data/.gitignore
CHANGED
data/.gitmodules
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Mindee Ruby API Library Changelog
|
2
2
|
|
3
|
+
## v1.1.2 - 2022-12-23
|
4
|
+
### Changes
|
5
|
+
* :recycle: use of `append_page` is better for adding pages to a new PDF
|
6
|
+
|
7
|
+
## v1.1.1 - 2022-08-08
|
8
|
+
### Fixes
|
9
|
+
* :bug: Fix for missing attribute accessor
|
10
|
+
|
3
11
|
## v1.1.0 - 2022-08-04
|
4
12
|
### Changes
|
5
13
|
* :sparkles: Add support for custom API classification field (#5)
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
# Contributing to mindee-api-ruby
|
2
|
+
|
3
|
+
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
|
4
|
+
|
5
|
+
The following is a set of guidelines for contributing to mindee-api-ruby which are hosted on GitHub.
|
6
|
+
These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
|
7
|
+
|
8
|
+
## Code of Conduct
|
9
|
+
|
10
|
+
This project and everyone participating in it is governed by the following [Code of Conduct](CODE_OF_CONDUCT.md).
|
11
|
+
By participating, you are expected to uphold this code.
|
12
|
+
Please report unacceptable behavior to [contact@mindee.com](mailto:contact@mindee.com).
|
13
|
+
|
14
|
+
## How Can I Contribute
|
15
|
+
|
16
|
+
### Reporting Bugs
|
17
|
+
|
18
|
+
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/).
|
19
|
+
|
20
|
+
To help maintainers and the community to be efficient, follow these guidelines:
|
21
|
+
|
22
|
+
* **Use a clear and descriptive title** for the issue to identify the problem.
|
23
|
+
* **Describe the exact steps which reproduce the problem** in as many details as possible.
|
24
|
+
When listing steps, **don't just say what you did, but explain how you did it**.
|
25
|
+
For example, with canvas related problem, explain if you used the mouse or a keyboard shortcut, what kind of image input it is etc...
|
26
|
+
* **Provide specific examples to demonstrate the steps**.
|
27
|
+
Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples.
|
28
|
+
If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
|
29
|
+
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
|
30
|
+
* **Explain which behavior you expected to see instead and why.**
|
31
|
+
* **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.
|
32
|
+
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
|
33
|
+
|
34
|
+
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
|
35
|
+
|
36
|
+
Include details about your configuration and environment:
|
37
|
+
|
38
|
+
* **Which version of mindee-api-ruby are you using?**
|
39
|
+
* **What's the name and version of the browser you're using, on which OS**?
|
40
|
+
|
41
|
+
### Suggesting Enhancements
|
42
|
+
|
43
|
+
Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/).
|
44
|
+
|
45
|
+
Make sure to provide the following information:
|
46
|
+
|
47
|
+
* **Use a clear and descriptive title** for the issue to identify the suggestion.
|
48
|
+
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
|
49
|
+
* **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
|
50
|
+
* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
|
51
|
+
* **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of the sdk which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
|
52
|
+
* **Specify which version of mindee-api-ruby you're using.**
|
53
|
+
* **Specify the name and version of the browser and OS you're using.**
|
54
|
+
|
55
|
+
### Pull Requests
|
56
|
+
|
57
|
+
The process described here has several goals:
|
58
|
+
|
59
|
+
- Maintain mindee SDK quality
|
60
|
+
- Fix problems that are important to users
|
61
|
+
- Engage the community in working toward the best possible SDK
|
62
|
+
- Enable a sustainable system for mindee's maintainers to review contributions
|
63
|
+
|
64
|
+
Please follow these steps to have your contribution considered by the maintainers:
|
65
|
+
|
66
|
+
1. Follow all instructions in [the template](.github/PULL_REQUEST_TEMPLATE.md)
|
67
|
+
2. Follow the [styleguides](#styleguides)
|
68
|
+
|
69
|
+
While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.
|
70
|
+
|
71
|
+
## Styleguides
|
72
|
+
|
73
|
+
### Git Commit Messages
|
74
|
+
|
75
|
+
* Use the present tense ("Add feature" not "Added feature")
|
76
|
+
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
|
77
|
+
* Limit the first line to 72 characters or less
|
78
|
+
* Reference issues and pull requests liberally after the first line
|
79
|
+
* Consider starting the commit message with an applicable emoji, see [gitmoji](https://gitmoji.carloscuesta.me/) as a reference.
|
80
|
+
|
81
|
+
Examples:
|
82
|
+
|
83
|
+
* :memo: Add usage section in README
|
84
|
+
* :sparkles: Add CONTRIBUTING file in repository
|
85
|
+
* :bug: MyComponent - Prevent MouseEvent from firing unexpectedly
|
86
|
+
|
87
|
+
### Code Styleguide
|
88
|
+
|
89
|
+
We keep our code base consistent and expect Ruby code to adhere to our Rubocop styleguide,
|
90
|
+
see the `.rubocop` file.
|
data/README.md
CHANGED
@@ -30,7 +30,8 @@ require 'mindee'
|
|
30
30
|
mindee_client = Mindee::Client.new(api_key: 'my-api-key').config_invoice
|
31
31
|
|
32
32
|
# Load a file from disk and parse it
|
33
|
-
api_response = mindee_client.doc_from_path(
|
33
|
+
api_response = mindee_client.doc_from_path('/path/to/the/file.ext')
|
34
|
+
.parse('invoice')
|
34
35
|
|
35
36
|
# Print a brief summary of the parsed data
|
36
37
|
puts api_response.document
|
@@ -47,7 +48,8 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key').config_custom_doc(
|
|
47
48
|
)
|
48
49
|
|
49
50
|
# Load a file from disk and parse it
|
50
|
-
api_response = mindee_client.doc_from_path(
|
51
|
+
api_response = mindee_client.doc_from_path('/path/to/the/file.ext')
|
52
|
+
.parse('pokemon-card')
|
51
53
|
|
52
54
|
# Print a brief summary of the parsed data
|
53
55
|
puts api_response.document
|
data/Rakefile
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'rake'
|
4
4
|
|
5
|
-
|
5
|
+
begin
|
6
|
+
require 'bundler/setup'
|
7
|
+
Bundler::GemHelper.install_tasks
|
8
|
+
rescue LoadError
|
9
|
+
puts 'although not required, bundler is recommended for running the tests'
|
10
|
+
end
|
11
|
+
|
12
|
+
task default: :spec
|
13
|
+
|
14
|
+
require 'rspec/core/rake_task'
|
15
|
+
RSpec::Core::RakeTask.new(:spec)
|
@@ -85,7 +85,7 @@ module Mindee
|
|
85
85
|
company_registration = @company_registration.map(&:to_s).join('; ')
|
86
86
|
taxes = @taxes.join("\n ")
|
87
87
|
out_str = String.new
|
88
|
-
out_str << '-----Invoice
|
88
|
+
out_str << '----- Invoice V3 -----'
|
89
89
|
out_str << "\nFilename: #{@filename}".rstrip
|
90
90
|
out_str << "\nInvoice number: #{@invoice_number}".rstrip
|
91
91
|
out_str << "\nTotal amount including taxes: #{@total_incl}".rstrip
|
@@ -3,6 +3,13 @@
|
|
3
3
|
module Mindee
|
4
4
|
# Document classification (custom docs)
|
5
5
|
class ClassificationField
|
6
|
+
# The classification value
|
7
|
+
# @return [String]
|
8
|
+
attr_reader :value
|
9
|
+
# The confidence score, value will be between 0.0 and 1.0
|
10
|
+
# @return [Float]
|
11
|
+
attr_accessor :confidence
|
12
|
+
|
6
13
|
# @param prediction [Hash]
|
7
14
|
def initialize(prediction)
|
8
15
|
@value = prediction['value']
|
data/lib/mindee/inputs.rb
CHANGED
@@ -98,8 +98,8 @@ module Mindee
|
|
98
98
|
new_pdf = Origami::PDF.new
|
99
99
|
|
100
100
|
to_insert = [current_pdf.pages[0], current_pdf.pages[-2], current_pdf.pages[-1]].take(max_pages)
|
101
|
-
to_insert.
|
102
|
-
new_pdf.
|
101
|
+
to_insert.each do |page|
|
102
|
+
new_pdf.append_page(page)
|
103
103
|
end
|
104
104
|
@io_stream = new_pdf.to_io_stream
|
105
105
|
end
|
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: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: marcel
|
@@ -63,9 +63,11 @@ extra_rdoc_files: []
|
|
63
63
|
files:
|
64
64
|
- ".gitattributes"
|
65
65
|
- ".gitignore"
|
66
|
+
- ".gitmodules"
|
66
67
|
- ".rubocop.yml"
|
67
68
|
- CHANGELOG.md
|
68
69
|
- CODE_OF_CONDUCT.md
|
70
|
+
- CONTRIBUTING.md
|
69
71
|
- Gemfile
|
70
72
|
- LICENSE
|
71
73
|
- README.md
|
@@ -121,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
123
|
- !ruby/object:Gem::Version
|
122
124
|
version: '0'
|
123
125
|
requirements: []
|
124
|
-
rubygems_version: 3.1.
|
126
|
+
rubygems_version: 3.1.6
|
125
127
|
signing_key:
|
126
128
|
specification_version: 4
|
127
129
|
summary: Mindee API Helper Library for Ruby
|