Skip to main content

A module to parse MT940 files

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mt940-0.8.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mt940-0.8.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file mt940-0.8.1.tar.gz.

File metadata

  • Download URL: mt940-0.8.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for mt940-0.8.1.tar.gz
Algorithm Hash digest
SHA256 a69b4998893855162ffa17c1b8e45d1591ed9e13afc1f11366027713795a7ccf
MD5 a2cab44ee537f6842fc6511ed4f2a331
BLAKE2b-256 7d385af45bca98f6f595fba66855e6fd604c47ffae91d439acc15a7ddb59a772

See more details on using hashes here.

File details

Details for the file mt940-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: mt940-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for mt940-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2acc136f9087a1772f051864ac89c89039053630e298777a74f557131d950fe
MD5 0206e550e9543143271e67cd77f9f18b
BLAKE2b-256 c1b83e06c34a0ff76a196e5d0031bac3ba0c32fa76a628ee988430b8ba101030

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page