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.7.0.tar.gz (10.8 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.7.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mt940-0.7.0.tar.gz
Algorithm Hash digest
SHA256 9bed7e1268bda588ce5c3b0a40b3eedb53ca5630b8a39c143a63a2438f3aa0d4
MD5 0357dfb632582b1c75d069c77133248a
BLAKE2b-256 1d331b07b0a505c1f1154f647a72e7e511564f7c5141a3be5e99a74a78f6e916

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mt940-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 335a66a217452766df77be8fffb0cd8a3015779380d53d4aa14681c371eb8bc2
MD5 2a3cd8b9ac3970ce923c7a00142433f7
BLAKE2b-256 48aa010db35fa65794979125ca8e8b7047642c548c59dc1dfdce02a9b3d4596e

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