mt940 is a parser for MT940 files.
Nutshell
Import:
>>> import os >>> from mt940 import MT940
Instanciate:
>>> mt940 = MT940('mt940/MT940.txt')
The statements:
>>> len(mt940.statements)
2
>>> statement = mt940.statements[0]
>>> statement.account
'123456789'
>>> statement.information
'13501/1'
>>> start_balance = statement.start_balance
>>> start_balance.date
datetime.date(2012, 5, 11)
>>> start_balance.amount
Decimal('5138.61')
>>> start_balance.currency
'EUR'
>>> end_balance = statement.end_balance
>>> end_balance.date
datetime.date(2012, 5, 14)
>>> end_balance.amount
Decimal('5638.62')
>>> end_balance.currency
'EUR'
The transactions:
>>> len(statement.transactions)
3
>>> transaction, _, _ = statement.transactions
>>> transaction.date
datetime.date(2012, 5, 12)
>>> transaction.booking
datetime.date(2012, 5, 14)
>>> transaction.amount
Decimal('500.01')
>>> transaction.id
'N654'
>>> transaction.reference
'NONREF'
>>> transaction.additional_data
'987654321'
>>> transaction.description # doctest: +NORMALIZE_WHITESPACE
'/TRTP/SEPA OVERBOEKING/IBAN/FR12345678901234/BIC/GEFRADAM\n/NAME/QASD JGRED/REMI/Dit zijn de omschrijvingsregels/EREF/NOTPRO\nVIDED'
To report issues please visit the mt940 bugtracker.
Metadata
Release files for mt940 0.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mt940-0.8.1.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mt940-0.8.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / mt940-0.8.1.tar.gz
| Download URL | mt940-0.8.1.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a69b4998893855162ffa17c1b8e45d1591ed9e13afc1f11366027713795a7ccf
|
|
BLAKE2b-256 checksum How to use checksums |
7d385af45bca98f6f595fba66855e6fd604c47ffae91d439acc15a7ddb59a772
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Release files / mt940-0.8.1-py3-none-any.whl
| Download URL | mt940-0.8.1-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2acc136f9087a1772f051864ac89c89039053630e298777a74f557131d950fe
|
|
BLAKE2b-256 checksum How to use checksums |
c1b83e06c34a0ff76a196e5d0031bac3ba0c32fa76a628ee988430b8ba101030
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|