Giter Site home page Giter Site logo

greenback-inc / greenback-java Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 5.0 2.9 MB

Java library to build modern applications with high-def itemized financial data. OCR, AI, and NLP for receipts, invoices, bills, and RFC822 email messages.

License: Apache License 2.0

Java 100.00%
ocr java receipts bills invoices nlp-machine-learning rfc822 email scala groovy

greenback-java's Introduction

Greenback Kit for Java

Maven Central Build Status

Greenback Logo

The official Greenback open source Kit for Java! Quickly build your JVM or Android application by leveraging our modular implementation in Java. Compatible with Java 8+, Android, and other JVM languages such as Scala, Kotlin, Groovy, and more.

The Greenback Platform consists of APIs to build modern applications with high-def itemized financial data. You can read more about our REST-based APIs and data models on the Greenback Developer Portal.

High-def itemized financial data includes all the details of a transaction that are missing on a typical credit card or bank feed. Rather than just an amount of money and a brief description, high-def itemized data includes the line items, vendor/supplier information, postal addresses, tax (sales, VAT, GST), payment instrument details, transaction type, invoice number, and more. In a nutshell, the fully detailed data that represents a GAAP-compliant financial transaction. Greenback provides a common data model and developer-friendly method to sync or extract data using various methods:

Vision API

Advanced AI, OCR (Optical Character Recognition), and NLP (Natural Language Processing) to extract structured transaction data from real world photos and documents in near real-time. You can quickly and easily build web or mobile applications that can convert images (PNG/JPEG) or documents (Microsoft Word/HTML/PDF) that contain receipts, bills, invoices, statements, and other types into structured and annotated data.

Greenback Kit on Android Demo

Mailbox API

Convert RFC822 emails, including attachments and embedded links, into structured transaction data. You can quickly convert original or forwarded RFC822 emails, including attachments and embedded URLs, into structured transaction data.

Greenback Mailbox API

Mailbox Connect API

Fetch itemized receipts & invoices from Gmail, Microsoft 365 & Yahoo Mail email accounts.

Connect API

Connect, authenticate and acquire transaction data directly from top retailers, marketplaces, platforms such as Amazon, Home Depot, Walmart, and more.

Greenback Connect API

Installation

Requirements

Dependencies and Modularity

The Greenback Kit for Java was designed to be flexible about what dependencies we require to run. Most functionality is in the greenback-kit-core module, which has just a single, tiny external dependency to simplify URL handling. Since parsing JSON and executing HTTP calls can bring in dependencies you may not want, the kit was designed to implement each of these as separate modules (jars) so you can choose which ones you want to use, or possibly even implement your own. For example, if you don't want to use Jackson for Json, you could easily swap in an implementation in Gson instead.

Gradle users

Add this dependency to your project's build file:

implementation "com.greenback:greenback-kit-jackson:1.0.5"
implementation "com.greenback:greenback-kit-okhttp:1.0.5"

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.greenback</groupId>
  <artifactId>greenback-kit-jackson</artifactId>
  <version>1.0.5</version>
</dependency>
<dependency>
  <groupId>com.greenback</groupId>
  <artifactId>greenback-kit-okhttp</artifactId>
  <version>1.0.5</version>
</dependency>

Usage

Vision

A demo of using the Greenback Vision API to extract a receipt from a photo (PNG/JPEG) is here: greenback-kit-okhttp/src/test/java/com/greenback/kit/demo

// build httpClient, pick baseUrl, and set accessToken...

final GreenbackClient client = new OkHttpGreenbackClient(
    httpClient,
    baseUrl,
    new JacksonGreenbackCodec(),
    accessToken);

Vision vision = client.createVision(new VisionRequest()
    .setAsync(true)
    .setDocument(new File("../samples/7eleven_sample.jpg")));

log.debug("Vision: id={}, name={}, status={}, updated={}",
    vision.getId(), vision.getName(), vision.getStatus(), vision.getUpdatedAt());
            
// poll every 500 ms for processing status
while (!vision.getStatus().isTerminal()) {
    vision = client.getVisionById(vision.getId());
                
    log.debug("Vision: id={}, name={}, status={}, updated={}",
        vision.getId(), vision.getName(), vision.getStatus(), vision.getUpdatedAt());
                
    Thread.sleep(500L);
}

You may also want to check out our sample Android application for Vision.

Mailbox

A demo of using the Greenback Mailbox API to extract a receipt from an RFC822 mime email message is here: greenback-kit-okhttp/src/test/java/com/greenback/kit/demo

// build httpClient, pick baseUrl, and set accessToken...

final GreenbackClient client = new OkHttpGreenbackClient(
    httpClient,
    baseUrl,
    new JacksonGreenbackCodec(),
    accessToken);

Message message = client.createMessage(new MessageRequest()
    .setAsync(true)
    .setDocument(new File("../samples/disney_sample.msg")));

log.debug("Message: id={}, name={}, status={}, updated={}",
    message.getId(), message.getName(), message.getStatus(), message.getUpdatedAt());

// poll every 500 ms for processing status
while (!message.getStatus().isTerminal()) {
    message = client.getMessageById(message.getId());

    log.debug("Message: id={}, name={}, status={}, updated={}",
        message.getId(), message.getName(), message.getStatus(), message.getUpdatedAt());

    Thread.sleep(500L);
}

License

This project and source code is licensed with Apache License 2.0.

Questions and Support

Please contact Greenback Support or Sales if you have any additional questions.

greenback-java's People

Contributors

jbarrus-gb avatar jjlauer avatar v3rs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.