Skip to content

Minor parsing errors #109

@htgoebel

Description

@htgoebel

Hi, thanks for this mighty module :-)

When parsing the statement shown below, I get some minor parsing errors in the field purpose:

  • No space before the applicant name
  • BIC is removed, but the string "BIC" is kept

Expected

  • Space between actual/main purpose (SVWZ) and applicant name (?32)
  • Either BIC removed or the actual BIC value (?30) appended: "BIC GENODEF1WDH"

Reproduce

import mt940, pprint
trans = mt940.parse
"""\
:61:2401231020DR30,00NDDTKREF+
:86:105?00Basislastschrift?10931?20EREF+DD-1-23.01.2024
?21KREF+20241022098765432109 00?22000000000237?23MREF+27
?24CRED+DE47ZZZ00012345678?25SVWZ+Mitgliedsbeitrag 
?26Mein Verein EREF: D?27D-1-23.01.2024 MREF: 27 CRE
?28D: DE47ZZZ00012345678 IBAN:?29 DE69280123450012345670 BIC
?30GENODEF1WDH?31DE69280123450012345670
?32Mein Verein e.V.?34992?60: GENODEF1WDH
""")
pprint.pp( trans[0].data)

Output:

…
 'purpose': 'MitgliedsbeitragMein Verein EREF: DD-1-23.01.2024 MREF: 27 CRED: '
            'DE47ZZZ00012345678 IBAN: DE69280123450012345670 BIC',
…

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions