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)
1
>>> statement, = mt940.statements
>>> 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.3.tar.gz (7.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: mt940-0.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mt940-0.3.tar.gz
Algorithm Hash digest
SHA256 c39125798a3cf3bbb2ad996916ed4823fb3bbed61913c62bacd3aa646d8923c8
MD5 874b3a12364d4124f896f86d13a01715
BLAKE2b-256 2295d4560aa9edab848f300c765f1a9c25f8541b14b0449514d2d78c99870ea3

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