Socket
Book a DemoInstallSign in
Socket

ng-bank-parser

Package Overview
Dependencies
Maintainers
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-bank-parser

0.1.7
bundlerRubygems
Version published
Maintainers
4
Created
Source

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.

FAQs

Package last updated on 14 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.