GithubHelp home page GithubHelp logo

prior99 / mt940-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from svenstaro/mt940-rs

0.0 2.0 0.0 131 KB

A MT940 parser in Rust

License: MIT License

Rust 98.63% JavaScript 0.68% Shell 0.69%

mt940-rs's Introduction

mt940-rs

Build Status Docs Status codecov Crates.io dependency status license

A strict MT940 bank statement parser in Rust.

Features

  • Parse MT940 bank statements.
  • Strict and well-researched.
  • Super simple API and nice Rusty structs.
  • Small commandline utility that allows for quick and easy conversion of MT940 statements to JSON.
  • Well tested with many automated tests to find weird corner cases.
  • Pretty fast.

Planned features

  • MT941 support
  • MT942 support

Library usage example

extern crate mt940;
use mt940::parse_mt940;

fn main() {
    let input = "\
        :20:3996-11-11111111\r\n\
        :25:DABADKKK/111111-11111111\r\n\
        :28C:00001/001\r\n\
        :60F:C090924EUR54484,04\r\n\
        :61:0909250925DR583,92NMSC1110030403010139//1234\r\n\
        :86:11100304030101391234\r\n\
        Beneficiary name\r\n\
        Something else\r\n\
        :61:0910010930DR62,60NCHGcustomer id//bank id\r\n\
        :86:Fees according to advice\r\n\
        :62F:C090930EUR53126,94\r\n\
        :64:C090930EUR53189,31\r\n\
        \r\n";

    let input_parsed = parse_mt940(input).unwrap();
    assert_eq!(input_parsed[0].transaction_ref_no, "3996-11-11111111");
}

CLI usage example

cargo run --bin sta2json tests/data/mt940/full/danskebank/MT940_DK_Example.sta

Documentation

Documentation is here.

Performance

Time to parse the provided MT940_FI_Example.sta:

mt940-rs (this crate) mt940-js (NodeJS) mt-940 (Python)
Time for file 0.054ms 0.08ms 1.15ms
Performance 600000 lines per sec 400000 lines per sec 28000 lines per sec

Caveats

Some banks bank use weird derivates of MT940 that do not strictly follow the specification. In that case, I recommend you do some pre-processing of those statements.

Resources and acknowledgements

Referencing proper docs is important because because banks seem to be somewhat lenient about their strictness in implementing MT940. Below I assembled a list of resources that I reference.

Other projects

iotafinance.com

Amazing interactive docs.

DanskeBank

They provide tons of good docs.

Bank Austria

Deutsche Bank

ABN AMRO

Westpac Banking

Societe Generale Srbija

Bank Millennium

DZ Bank

Handelsbanken

ING Bank

Kontopruef

Rabo Bank

SEPA for Corporates

mt940-rs's People

Contributors

svenstaro avatar

Watchers

James Cloos avatar Frederick Gnodtke 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.