Code Monkey home page Code Monkey logo

zilverline-mt940's Introduction

MT940

Full parser for MT940 files, see MT940. This is based on the original gem of Frank Oxener - Agile Dovadi BV but completely redesigned and extended.

The following Dutch banks are implemented:

  • ABN Amro
  • ING
  • Rabobank
  • Triodos

Usage

With the file name as argument:

file_name = '~/Downloads/ing.940'

@parse_result = MT940::Base.parse_mt940(file_name)

or with the file itself:

file_name = '~/Downloads/ing.940'

file = File.open(file_name)

@parse_result = MT940::Base.parse_mt940(file)

after parsing:

@parse_result.each do |account_number, bank_statements|
  puts "Account number #{account_number} has #{bank_statements.size} bank statements"
  bank_statements.each do |bank_statement|
    puts "Bank statement has balance of #{bank_statement.previous_balance.amount} at date #{bank_statement.previous_balance.date}"
    bank_statement.transactions.each do |transaction|
      # do something with transaction
      # ...
    end
    puts "Bank statement has new balance of #{bank_statement.new_balance.amount} at date #{bank_statement.new_balance.date}"
  end
end
  • Independent of the bank

    • a parse_result consists of:

      • a map with account numbers as key and a list of BankStatements (http://en.wikipedia.org/wiki/Bank_statement)
      • A BankStatement is a summary of financial transaction in a certain period of time.
        • It is a Struct
        • It contains a previous_balance (Balance) and a new_balance (Balance)
        • It has a list of Transactions
          • a transaction always consists of:
            • accountnumber
            • bank (for example Ing, Rabobank or Unknown)
            • date
            • amount (which is negative in case of a withdrawal)
            • description
            • contra account
  • With the Rabobank its owner is extracted as well.

Running tests

bundle install

bundle exec rake spec

Copyright

Copyright (c) 2012 Frank Oxener - Agile Dovadi BV. See LICENSE.txt for further details.

zilverline-mt940's People

Contributors

dovadi avatar lvonk avatar mikefranken avatar bforma avatar

Watchers

James Cloos 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.