skillfed

mt-940

A library to parse MT940 files and returns smart Python collections for statistics and manipulation.

mt-940 v5.0.0 696.1K downloads/30d#5,305 on PyPI106
Permissive license BSD-3-Clause Active released

What it is and what it does

This is a parser for MT940 bank statement files—a SWIFT standard format used by banks worldwide to exchange transaction data. It reads these files and returns fully typed Python collections where transactions, amounts, balances, and dates are rich objects rather than raw strings, making them immediately usable for aggregation, filtering, and analysis.

The library has no runtime dependencies and includes type information (py.typed), so it works cleanly in typed codebases. It handles quirks from many real banks through a combination of sensible defaults and opt-in extensions: you can parse a standard statement with a single call, but for banks with non-standard tag layouts, you can register custom tag handlers. It also supports multiple statements in one file, JSON serialization, and custom transaction grouping rules.

Use it for:

  • Extract and reconcile bank transactions from MT940 files into a Python application for accounting or bookkeeping.
  • Aggregate statement-level data like opening and closing balances across multiple bank files for financial reporting.
  • Serialize parsed statements to JSON for downstream processing, APIs, or storage in a data pipeline.
  • Handle bank-specific MT940 variants by registering opt-in tags without forking the parser.
  • Build transaction analysis tools that work with typed amount and date objects instead of parsing strings manually.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses MT940 bank statement files into fully typed Python collections with smart models for amounts, balances, and dates, supporting multiple banks and real-world format quirks.

Yes. Actively maintained, zero runtime dependencies, ships with full type information, and handles a wide range of real-world bank formats. Suitable for any Python project that needs to parse MT940 statements reliably. No known security issues, permissive license, and low install friction make it a straightforward choice.

Install

mt-940 on PyPI

pip

pip install mt-940

uv

uv add mt-940

poetry

poetry add mt-940

Installing mt-940

Before you install

Low friction: pure Python with zero runtime dependencies, ships as a wheel, and actively maintained with a recent release 53 days ago.

License in practice

BSD-3-Clause is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install mt-940

import mt940

transactions = mt940.parse('statement.sta')
for transaction in transactions:
    print(transaction.data['date'], transaction.data['amount'])

Requires Python 3.10 or newer.

Verify before relying

  • Whether the package handles all real-world bank statement variations without manual intervention beyond opt-in tags.
  • Performance characteristics when parsing large statement files or many statements in sequence.

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 53 days since the last release
Last repo commit
First released
Downloads 696,138/month — #5,305 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mt_940-5.0.0-py3-none-any.whl

Keywords: MT940

Development Status :: 6 - MatureIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

MT940 bank statement parserparse bank statements PythonMT940 file readerbank transaction parsingSWIFT statement processingfinancial data extractionbank file format parser
bankingfile-parsingfinancial-data

More Python Modules packages