-
Notifications
You must be signed in to change notification settings - Fork 42
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
OFX Tag Issue - List Index Out of Range #38
Comments
Allow me to go on a slight excursion here :). From experience running into this type of situation, I'd normally recommend biting the bullet and simply writing a csv importer for your CSV file. Because even if you manage to get the csv -> ofx -> import route working now, between future breaking changes to the csv and missing features in ofxstatement, problems will invariably crop up in layers that make it very hard for you to debug. This is a big part of my motivation for writing Ofxstatement's last commit was Apr 2021. That's a big red flag to me in creating a dependency on that repo. Now for the other side of the argument (favoring considering the csv->ofx->import route):
If it were me, I'd definitely go with writing my own csv importer and solving the problem once and for all, since (1) and (2) above are not a big factor for me. I don't have a strong recommendation for you on which path to choose, but if you go with writing your own importer, I'm here to help answer questions as they come up. And if at all you plan to write more importers, the experience will be very valuable and will save time in the future. Now back to a direct answer to your question: I tend to have very limited time these days, and if you manage to send me a test case that definitely mirrors the issue, unless it's something I can fix instantly (< 5 mins), it'll probably sit in my inbox for an indefinite amount of time, unfortunately. You seem to have done due diligence here, so it's unlikely I'll find something you haven't found. But feel free to send me something, and I can send a couple minutes to see if something obvious stands out. Speaking of which, have you tried looking at all empty tags and removing them? |
Thanks again for the quick and extensive response. I think I'll go the route of writing a CSV importer for the reasons you mentioned - I had written one for I started to write one but have run into errors about the
This is my importer (based on the
If I uncomment the
On your point about transfers across currency, I was thinking about just putting them through an equity account, e.g. USD and CAD specific accounts, that shouldn't matter if they don't add up to 0, though if you have strong feelings about this please let me know! |
You're welcome! The issue you ran into is because I'm not yet sure if Wise fits neatly into one of the existing transaction builders (same as what I mentioned above). If you could send me an anonymized example of the csv, and the expected output (beancount transactions), I can probably speed up your importer writing by either providing guidance or adding the transaction builder code if that's necessary. Use the ideal Beancount transaction you'd like to see, without worrying about using Equity accounts :). |
Sorry for the delay in response. I've attached an anonymized CSV file here so it may be useful for others to read/look at the process (note that Wise uses dd/mm/yyyy date formats). Below is the expected output.
Thanks for your help! |
This is straightforward and quite simple, and can be handled easily by
Nothing else should be needed, as smart_importer will take care of the target accounts. Feel free to let me know if you have any questions at all! |
Thanks very much @redstreet! I had written the following importer which seemed to work as hoped, and at first glance looks similar to your propositions, but when I get time to check in detail I'll update this issue with a final working copy. For the time being I'll close the issue as I think we're sorted as far as this issue is concerned. Thanks very much for your patience and time in walking me through this process.
|
You're welcome! You shouldn't need the EDIT: ah, you probably wrote it before I updated |
Hi Again,
One of my accounts (Wise), doesn't export OFX files, but there is a tool to convert the CSV files to OFX files (
{ofxstatement}
). Unfortunately, the Reds OFX importers don't seem to be able to read the converted files.I currently use
{bean count-import}
, which is able to import these OFX files after removing an empty<DTASOF />
tag from the end of the file - see here and here for more details. However, I prefer the logic of your framework and like the idea of using your plugins, so I'm trying to make the switch, but this is a sticking point.I get the error below.
where my importer has the following code
Based on the trace it looks like it might be an issue with the
{ofxparse}
package and possible empty tags, as well as this issue`, so I appreciate this may not be something that can be fixed here, but I have only moderate python experience so my ability to diagnose a problem and hack a solution is limited, and I figured I may be missing something.If it would be useful, I can try and put together a sample OFX file for a reprex.
Thanks,
The text was updated successfully, but these errors were encountered: