-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing transactions : key 64 #85
Comments
The If you would add an extra post processor in import mt940
import pprint
mt940.tags.BalanceBase.scope = mt940.models.Transaction
# The currency has to be set manually when setting the BalanceBase scope to Transaction.
transactions = mt940.models.Transactions(processors=dict(
post_transaction_details=[
<your processors>
],
))
with open('filename.sta') as f:
data = f.read()
transactions.parse(data)
for transaction in transactions:
print('Transaction: ', transaction)
pprint.pprint(transaction.data) |
Hi Sorry I realised I pasted the wrong thing in my message yesterday. I meant in the method Do you think it's possible to fix that, since I don't think it's specific to my bank but to mt940 extended format ? I think it's somehow the same problem as for this PR : #48 |
added support for more "additional purpose" keys to fix #85 v4.22.0 # gpg: Signature made Wed Jun 17 01:28:43 2020 CEST # gpg: using RSA key 149325FD15904E9C4EB89E95E81444E9CE1F695D # gpg: checking the trustdb # gpg: marginals needed: 3 completes needed: 1 trust model: pgp # gpg: depth: 0 valid: 3 signed: 1 trust: 0-, 0q, 0n, 0m, 0f, 3u # gpg: depth: 1 valid: 1 signed: 0 trust: 1-, 0q, 0n, 0m, 0f, 0u # gpg: next trustdb check due at 2021-07-23 # gpg: Good signature from "Rick van Hattem <wolph@wol.ph>" [ultimate] # gpg: aka "[jpeg image of size 9662]" [ultimate]
I've created a new release that has this fix. Can you check if it works for you @elisaprio? Sorry for the slow response, I've been really busy so it's hard to find time |
Thank you so much ! This will work for me. Do you think it would be also be possible to add a blank space before adding the new value ? Or is it unwise ? And sorry for the late reply too ! So no problem for the time =) |
The problem is (and with the entire standard in general) that nearly every bank has its own interpretation of the standard. While it might fix it for your bank, it will breakt it for some others. I can add it as a configurable option though, from what I see in my tests there's not single testfile that currently has a format where it makes a difference though. Do you have an example file by any chance? |
added optional support for spaces in extra details post processor to fix #85 v4.23.0 # gpg: Signature made Thu Jun 25 23:04:59 2020 CEST # gpg: using RSA key 149325FD15904E9C4EB89E95E81444E9CE1F695D # gpg: Good signature from "Rick van Hattem <wolph@wol.ph>" [ultimate] # gpg: aka "[jpeg image of size 9662]" [ultimate]
Looks like there was actually 1 file that used this (and doesn't need the space). You can use the version with spaces like this: https://github.com/WoLpH/mt940/blob/2e3669f9f0fd77abd5f4d5e58fe26b27f7620b40/mt940_tests/test_processors.py#L93-L97 |
Thank you so much ! It works perfectly for me !! |
I realise this is a "How to use python" question, but how do I get at the results of the post_transaction_details?
results in
|
Hello
First thank you so much for this parser !
In
result.get("additional_purpose","").replace("\r\n"," ")
key ?64 is missing. It's a part of the address. Could it be added in "additional_purpose" field ?And for those address related keys, could spaces be added between each key (for example write something like
result[key60] = f"{result[key60] or ''} {value}"
instead ofresult[key60] = (result[key60] or '') + value
) in order to facilitate future address parsing ?Thank you in advance for your work,
Elisa
The text was updated successfully, but these errors were encountered: