Git Product home page Git Product logo

abbyy-cli's Introduction

Abbyy

A basic command line app for Abbyy's OCR Service.

Installation

Clone the repository:

git clone [email protected]:aquaflamingo/abbyy.git

Install dependencies

cd abbyy

# This will build a local gem package for you to install on your system if you choose to
bundle exec rake install:local

# This will install the gem to your current active gemset (e.g. rbenv, or rvm)
gem install pkg/abbyy-0.1.0.gem

abbyy help

Commands:
	 abbyy help
	 abbyy process

If you don't want to install the gem, you can simply clone the repository and run:

bundle exec exe/abbyy process exampledata/dead-souls.png > dead-souls-results.txt

Usage

Setting Up Credentials

The configuration class absorbs the Abbyy Cloud credentials from the environment variables, so set your shell environment up with these values prior to running the process:

export APP_ID=<your_id>
export APP_PASSWORD=<your_passowrd>
export APP_REGION=<your_region> # only EU supported atm

Alternatively, you can set up the values in the scripts/example.env.sh and simply source this file before hand (makes things easier, but, make sure you don't commit your credentials to version control!).

Examples

You can use the example data provided in exampledata folder, or provide your own file. Using the example data:

abbyy process ./exampledata/dead-souls.png > dead-souls-results.txt

The program will upload the png file to Abbyy's OCR cloud and perform recognition on it. Results are downloaded and sent to STDOUT. In the future, adding a flag for OUTPUT path would be cool. We can see the results by reading the file:

cat dead-souls-results.txt

"For what reason are you abusing me? An I in any way at fault for     
declining to play cards? Sell me those souls if you are the man to    
hesitate over such rubbish."                                          
"The foul fiend take you! I was about to have given them to you for   
nothing, but now you shan't have them at all---not if you offer me    
three kingdoms in exchange. Henceforth I will have nothing to do with 
you, you cobbler, you dirty blacksmith! Porphyri, go and tell the     
ostler to give the gentleman's horses no oats, but only hay."         
This development Chichikov had hardly expected.                       
"And do you," added Nozdrev to his guest, "get out of my sight."      
Yet in spite of this, host and guest took supper together--even though
on this occasion the table was adorned with no wines of fictitious    
nomenclature, but only with a bottle which reared its solitary head   
beside a jug of what is usually known as vin ordinaire. When supper   
was over Nozdrev said to Chichikov as he conducted him to a side room 
- --- had been made up:                                               

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

License

The gem is available as open source under the terms of the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.