Giter Club home page Giter Club logo

ng-bank-parser's Introduction

Ng::Bank::Parser

This is a simple gem to parse Nigerian bank statements of all formats. If your bank and/or file format is not supported, consider reading the contribute wiki and submitting a pull request.

API

Because not everyone develops in rails, we created a public API to use the gem at http://bank-parser.square-api.com/parse. The parameters are (bank_key, file_path, password). Read the Usage section for more information

http://bank-parser.square-api.com/parse(bank_key, file_path, password)

Installation

Add this line to your application's Gemfile:

gem 'ng-bank-parser'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ng-bank-parser

Usage

Using the gem is pretty straightforward and simple.

result = NgBankParser::Router.parse(bank_key, file_path, password)

bank_key is the key of the bank that provides the statement. There's a list of supported banks and formats below, therefore use the key provided for each bank.

file_path is obviously where the file you're trying to parse exists.

password (optional) it's only required when the file you want to parse is password protected.

result is a hash that contains all the information you need from your statment.

result = {
    status: 200,
    data: {
        bank_name: the_bank_name,
        account_number: the_account_number,
        account_name: the_account_name,
        from_date: first_transaction_date,
        to_date: last_transaction_date,
        transactions: an_array_of_transaction_hashes
    }
}

:status can either be 200 or 400. 200 for when the parsing is succesful and 200 for when it's not. A status of 400 is accompanied with an error message that aims to clarify why it could not parse the file.

result = {
    status: 400,
    message: "RELEVANT ERROR MESSAGE"
}

Furthermore, :transactions in the result hash is an array of hashes. Below is an example of a transaction hash

transaction = {
    date: transaction_date,
    amount: transaction_amount,
    type: debit_or_credit,
    balance: balance_after_transaction,
    remarks: remarks,
    ref: reference_id, # as provided by the statment
}

List of Supported Banks

United Bank for Africa:

  • key: uba
  • supported formats: pdf

Guaranty Trust Bank:

  • key: gtb
  • supported formats: xls, xlsx

First Bank:

  • key: firstbank
  • supported formats: pdf

Heritage Bank:

  • key: hb
  • supported formats: pdf

Access Bank:

  • key: accessbank
  • supported formats: pdf

Ecobank:

  • key: ecobank
  • supported formats: pdf

Contributing

Documentation on contribution can be found in the contribution wiki

License

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

ng-bank-parser's People

Contributors

fathermerry avatar lekansogunle avatar lolu avatar ollaollu avatar onyekvchi avatar timigod avatar unicodeveloper avatar

Stargazers

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

Watchers

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