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.6.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

mt940-0.6.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mt940-0.6.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for mt940-0.6.0.tar.gz
Algorithm Hash digest
SHA256 cfd06af4d48612d3958c1ffb1c17fc542a43bdc9b8b5b9024f0ff7ce0da88903
MD5 22febf647204f70be2e26b39427f3b91
BLAKE2b-256 0ce34da617ebc33cae70632740841a91b878f1efc4b5fb3ab6040e314b953db7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mt940-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for mt940-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6ff57134299258b24bdad50165e17f20135bbcf72856ce0f42c68043b2124e7
MD5 a0229e0e9e231ede2aadce62d05d74ae
BLAKE2b-256 744f050c708ae1aff9242723b0b28237708582a6e98f98d45cc4116295d336f9

See more details on using hashes here.

Supported by

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