Skip to main content

beangulp-mt940

beangulp importer for SWIFT MT940 bank statements (tested against UBS Switzerland exports), built on the mt-940 parser.

What it does

  • Drafts one beancount transaction per :61: statement line, with the bank's unique entry reference (the part after //) as mt940_ref: metadata. extract() skips references already present anywhere in the existing ledger — re-running an import is always safe.
  • Emits a balance assertion from the :62F: closing balance, dated the day after (beancount balances are beginning-of-day).
  • Skips zero-amount noise entries (e.g. UBS "Balance closing of service prices").
  • Optional payee_rules draft the counter leg: an iterable of (regex, account, flag) matched case-insensitively against the payee and the full :86: details. Unmatched entries keep the ! review flag and the cash leg only — classification, VAT treatment, and document evidence stay a human decision.

Usage

from beangulp_mt940 import Importer

importer = Importer(
    "Assets:Bank:Checking",
    iban="CH93 0076 2011 6238 5295 7",   # identify() filter, optional
    payee_rules=(
        (r"client ag", "Assets:Receivable", "*"),
        (r"hosting",   "Expenses:IT:Hosting", "!"),
    ),
)
entries = importer.extract("statement.mt940", existing=ledger_entries)

Works standalone (as above) or as a regular importer in a beangulp import_config.py.

Notes on UBS specifics

  • UBS puts the counterparty in :86: after a transaction code and ? (DE1?Google Workspace …); the importer's payee heuristic handles both this and plain details.
  • The supplementary line under :61: ("Debit card payment", "e-banking credit", …) becomes the narration.
  • Transaction dates use the value date; the entry (booking) date is available in the source if you need it.

Release files for beangulp-mt940 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beangulp-mt940 0.1.0
File Size Uploaded
beangulp_mt940-0.1.0.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beangulp-mt940 0.1.0
File Interpreter ABI Platform
beangulp_mt940-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.2 kB

Release files / beangulp_mt940-0.1.0.tar.gz

Download URL beangulp_mt940-0.1.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
263433b9efb255dd0ffd28e14d4187b5ac6d15edaf0aa1224f26a694d0b40762
BLAKE2b-256 checksum
How to use checksums
4339d52a31fa1e8d27ac790183b383a600826a30d8de407d7324461de95ec121
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release files / beangulp_mt940-0.1.0-py3-none-any.whl

Download URL beangulp_mt940-0.1.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d348eacb8013380da262de1ca59633474b8beee0a102e16a762dfbf604002b59
BLAKE2b-256 checksum
How to use checksums
5b42267b09f17dd9bce46bf271e3a0f56e0dd92e14eeeb7b69f4c15b4cfaddca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page