# mt940.processors module

mt940.processors.add_currency_pre_processor(currency, overwrite=True)

mt940.processors.date_cleanup_post_processor(transactions, tag, tag_dict, result)

mt940.processors.date_fixup_pre_processor(transactions, tag, tag_dict, *args)

  Replace illegal February 29, 30 dates with the last day of February.

  German banks use a variant of the 30/360 interest rate calculation, where each month has always 30 days even February. Python’s datetime module won’t accept such dates.

mt940.processors.mBank_set_iph_id(transactions, tag, tag_dict, *args)

  mBank Collect uses ID IPH to distinguish between virtual accounts, adding iph_id may be helpful in further processing

mt940.processors.mBank_set_tnr(transactions, tag, tag_dict, *args)

  mBank Collect states TNR in transaction details as unique id for transactions, that may be used to identify the same transactions in different statement files eg. partial mt942 and full mt940 Information about tnr uniqueness has been obtained from mBank support, it lacks in mt940 mBank specification.

mt940.processors.mBank_set_transaction_code(transactions, tag, tag_dict, *args)

  mBank Collect uses transaction code 911 to distinguish icoming mass payments transactions, adding transaction_code may be helpful in further processing

mt940.processors.transaction_details_post_processor(transactions, tag, tag_dict, result, space=False)

  Parse the extra details in some transaction formats such as the 60-65 keys.

  Parameters:

    - transactions (mt940.models.Transactions) – list of transactions

    - tag (mt940.tags.Tag) – tag

    - tag_dict (dict) – dict with the raw tag details

    - result (dict) – the resulting tag dict

    - space (bool) – include spaces between lines in the mt940 details

mt940.processors.transaction_details_post_processor_with_space(transactions, tag, tag_dict, result, *, space=True)

  Parse the extra details in some transaction formats such as the 60-65 keys.

  Parameters:

    - transactions (mt940.models.Transactions) – list of transactions

    - tag (mt940.tags.Tag) – tag

    - tag_dict (dict) – dict with the raw tag details

    - result (dict) – the resulting tag dict

    - space (bool) – include spaces between lines in the mt940 details

mt940.processors.transactions_to_transaction(*keys)

  Copy the global transactions details to the transaction.

  Parameters:

    *keys (str) – the keys to copy to the transaction