1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! A Rust library for parsing **CAMT.053** (ISO 20022 Bank-to-Customer
//! Statement) XML files and converting them to **MT940** format.
//!
//! CAMT.053 is a verbose, deeply nested XML schema used by many European
//! banks to deliver account statements. This crate parses that schema and
//! reduces it to a small, ergonomic model ([`SimpleStatement`] /
//! [`SimpleTransaction`]) suitable for use in applications, plus a
//! convenience method to render the result as MT940 text for legacy
//! banking software.
//!
//! # Example
//!
//! ```no_run
//! use camt053::SimpleStatement;
//!
//! let statements = SimpleStatement::load("statement.xml")?;
//! for statement in &statements {
//! println!("Account: {}", statement.account);
//! for transaction in &statement.transactions {
//! println!("{transaction}");
//! }
//! }
//! # Ok::<(), camt053::CamtError>(())
//! ```
//!
//! [`SimpleStatement::load`] also accepts a `.zip` archive containing one or
//! more camt.053 XML files (as commonly delivered by banks for multi-day
//! exports); the contained statements are merged per account.
//!
//! # Feature overview
//!
//! - [`SimpleStatement::load`] — parse a `.xml` file (or `.zip` archive) into
//! a list of [`SimpleStatement`]s, one per account.
//! - [`SimpleStatement::to_mt940`] — render a statement as an MT940 message.
//! - [`CamtError`] — the single error type returned by all fallible
//! operations in this crate.
pub use ;
pub use CamtError;
pub use ;