camt053 0.1.0

CAMT.053 (ISO 20022) bank statement parser and MT940 converter
Documentation

camt053

Crates.io Documentation License: MIT

A Rust library and command-line tool for parsing CAMT.053 (ISO 20022 Bank-to-Customer Statement) files and converting them to MT940 format.

Features

  • Parse camt.053.001.02 XML statements (including from .zip archives)
  • Reduce the verbose CAMT.053 schema into a simple, ergonomic model (SimpleStatement / SimpleTransaction)
  • Use this simplified model to import CAMT.053 statements into your own applications
  • Convert statements to MT940 text format, for use in legacy banking software
  • Command-line binary for quick inspection or conversion of statement files

Installation

As a command-line tool:

cargo install camt053

As a library, add it to your Cargo.toml:

[dependencies]
camt053 = "0.1"

Command-line usage

# Print the transactions in a CAMT.053 file (or a .zip containing many CAMT.053 files)
camt053 statement.xml

# Convert to MT940 instead of printing
camt053 --mt940 statement.xml

Library usage

use camt053::SimpleStatement;

let statements = SimpleStatement::load("statement.xml")?;
for statement in &statements {
    println!("Account: {}", statement.iban);
    for transaction in &statement.transactions {
        println!("{transaction}");
    }
}
# Ok::<(), camt053::CamtError>(())

License

Licensed under the MIT license.