Skip to content

v5.1.0

Choose a tag to compare

@wolph wolph released this 02 Sep 23:30
· 50 commits to develop since this release
v5.1.0
ca84dc9

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, and mt940.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.Options with ten switches: applicant_iban (#132, ?31 gets its own field again), merge_keeps_values (a structured :86: no longer nulls the :61: customer reference), reversal_sign (#130, #131, RC is 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_bom and gvc_leading_text. Pass it to parse(), parse_statements() or Transactions.
  • 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 with re.error.
  • Two structured :86: tags on one :61: no longer crash on None += str.
  • Tag.parse raises the documented RuntimeError for unmatched values instead of re.error.
  • Amount, SumAmount and Balance are hashable, and Transactions.currency returns None instead 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 raises FileNotFoundError instead of a bare AssertionError.

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.