Repository navigation
v5.1.0
Compatibility
- No output changes by default. Every parsing fix that changes the output for input 5.0.0 accepted is opt-in through
mt940.Options, andmt940.Options.all()switches all of them on. The next major release turns them on by default. Inputs that made 5.0.0 raise now parse in every mode.
Features
mt940.Optionswith ten switches:applicant_iban(#132,?31gets its own field again),merge_keeps_values(a structured:86:no longer nulls the:61:customer reference),reversal_sign(#130, #131,RCis negative),case_insensitive_marks,timezone_offset(:13D:offsets read as hours and minutes),unbounded_details(no 585-character cap on:86:),non_swift_free_text,floor_limit_blank_mark,strip_bomandgvc_leading_text. Pass it toparse(),parse_statements()orTransactions.- Python 3.14 support.
Fixes
:13D:and:13:without an offset, or with a negative one, no longer crash.:NS:values with free-form lines no longer abort the parse withre.error.- Two structured
:86:tags on one:61:no longer crash onNone += str. Tag.parseraises the documentedRuntimeErrorfor unmatched values instead ofre.error.Amount,SumAmountandBalanceare hashable, andTransactions.currencyreturnsNoneinstead of raising for a balance without an amount.- File descriptors are accepted as sources again, unsupported sources raise
TypeError, and a missing path-like source raisesFileNotFoundErrorinstead of a bareAssertionError.
Maintenance
- Every ruff rule enabled, four type checkers (mypy, basedpyright, pyrefly, ty), 100% line and branch coverage, tox envs per check, GitHub Actions pinned to commit SHAs with least-privilege permissions, zizmor and CodeQL in CI.
- The golden fixtures pin both the default and the opt-in output.
Thanks to @DylanMerigaud for #131 and for the analysis behind #132.
Published to PyPI: https://pypi.org/project/mt-940/5.1.0/
Attached artifacts are GPG-signed (.asc) with key E81444E9CE1F695D.