mt-940
A library to parse MT940 files and returns smart Python collections for statistics and manipulation.
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-940uv
uv add mt-940poetry
poetry add mt-940Installing 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
bai2Parses and writes BAI2 files, a standard format…
permissive · top 15,000 on PyPI
beancountBeancount is a double-entry accounting system…
copyleft · top 15,000 on PyPI
fintsA pure-Python implementation of the FinTS 3.0…
copyleft · top 15,000 on PyPI
ofxparseParses Open Financial Exchange (.ofx) format…
permissive · top 15,000 on PyPI
ofxtoolsParses, generates, and converts Open Financial…
copyleft · top 15,000 on PyPI
django-moneyAdds Money and currency field types to Django…
permissive · top 5,000 on PyPI
python-stdnumParses, validates, and reformats standard…
copyleft · top 5,000 on PyPI
banksBanks is a template language and prompt…
permissive · top 5,000 on PyPI
lkmlParses LookML strings into Python objects or…
permissive · top 5,000 on PyPI
cybrid-api-bank-pythonPython client library for the Cybrid Bank API,…
permissive · top 15,000 on PyPI