Giter Club home page Giter Club logo

klippa-client's Introduction

Klippa-client

Description

A Python client to parse files and receive/save json from the Klippa OCR API.

Installation

This project requires Python 3.8+ to run. Install the necessary Python dependencies:

$ cd klippa-client/
$ pip install -r requirements.txt

Quickstart

The easiest way to get going is to use the CLI to send a file or directory as the example below:

$ python klippa-client.py --key <your_api_key> --file <filepath> --template <preferred_template> --save

As an example to parse a file named "numbers.pdf" that you put in the same directory as klippa-client you could use this command(be sure to use your own API key!):

$ python klippa-client.py --key abcdefg1234567 --file numbers.pdf --template financial_full --save

The --save flag ensures the JSON output from the Klippa OCR API will be saved in a newly made directory namely: klippa-client/output

Config

An easy way to globally set your API key, preferred template and text extraction options for .pdf files is to make your very own Klippa Config File(.kcf) in the klippa-client/config directory.

To make things easy, an empty .kcf file will be generated on first run without passing the --key option.

A standard .kcf file looks like this:

API_KEY=abcdefghijklmnopqrstuvwxyz0123456789
TEMPLATE=financial_full
TEXT_EXTRACTION=full

Valid configuration options include:

API_KEY=[apikey[a-zA-Z0-9]]
TEMPLATE=[financial_full]
TEXT_EXTRACTION=[fast/full]

When your .kcf file is setup correctly you don't have to pass those arguments to the client anymore. A simple:

$ python klippa-client.py --watch <directory>

Will be enough to get things rolling after that!

Examples

Files

To send a file:

$ python klippa-client.py --key <your_api_key> --file <filepath> 

Literal example:

$ python klippa-client.py --key abcdefg1234567 --file big-numbers.pdf

Directories

To send a directory of files:

$ python klippa-client.py --key <your_api_key> --dir <directorypath> 

Literal example:

$ python klippa-client.py --key abcdefg1234567 --dir /etc/files/

To watch/monitor a directory for new or changed files to be automatically picked up and parsed:

$ python klippa-client.py --key <your_api_key> --watch <directorypath> 

Literal example:

$ python klippa-client.py --key abcdefg1234567 --watch /etc/files

Support

For all your client troubles, feel free to submit a bug report to: [email protected]

klippa-client's People

Contributors

frankhuurman avatar

Watchers

 avatar

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.