Now I find myself stuck. All I get ";; -*- mode: beancount -*-". I've inserted some print functions inside the methods, and it seems like it's not reaching prepare_raw_columns().
You’re doing nothing wrong, BTW. CSV parsing changed csvreader a while ago, and wasn’t fixed in this importer since it wasn’t a standard pytest (the root of the issue). As shown here, prepare_raw_columns() doesn’t exist any more, and the importer needs to use one of these instead. If there's a reason to use this importer, I'd be happy to review a PR or even assist in making the fixes. If ofx works for you, I'd be inclined to simply remove this importer.
Red
My reason for using .csv over .ofx is simply familiarity and ease of starting up.I have no experience with ofx and thought the learning curve would be much steeper, and I already feel like I'm drowning a bit as a layperson.
I know it may seem like that, especially given ofx is not a human readable format. But might I suggest giving that a shot first, and you might be pleasantly surprised. Because there is nothing to do, no importer to write, since it is a machine format with an official spec, unlike csv. The learning curve should be close to zero. There are other benefits too.
I'll look into the csvreader changes you mentioned to try making a replacement for prepare_raw_columns() and also look further into ofx.
If I were you, I’d definitely spend five minutes with ofx first. And reds-importers ships with ofx-summarize which you can use to peek inside and poke around an ofx file, which makes it a lot less opaque and easy on a layperson.
Thanks for the help here and confirming I'm doing alright, and also thank you for maintaining it!
Happy to, and glad its helpful!
Glad you got it working with ofxget. bean-download is just a wrapper around ofxget or whatever command you have to parallelize all your downloads. If you don’t have several accounts you’re using it with, it’s of limited use. The built in template for fidelity is here, and lets you store your password securely in pass so it’s not stored in plaintext. You could simply paste your working ofxget command into the bean-download config file to get it to work if the parallelization is useful for you. Either way, that’s the last thing I’d do after I got everything else in the import workflow working first.
And oh wow, I’d forgotten that Fidelity stopped letting you download ofx via their website, and only let you do it via direct download.
This is uncommon, but typically because there was an issue downloading the ofx. Usually because of authentication problems. Have you examined the ofx to see if it’s valid?
Try this to make it more readable: sed 's/>/>\n/g' xyz.ofx
You should see something like this on the top:
<STATUS> <CODE> 0 </CODE> <SEVERITY> INFO </SEVERITY> <MESSAGE> Success </MESSAGE> </STATUS>If you see that, then try a really simple parse:
#!/usr/bin/env python3 import ofxparse ofx_file_path = "your_ofx_file.ofx" with open(ofx_file_path, 'r') as ofx_file: ofx = ofxparse.OfxParser.parse(ofx_file) print("Account type:", ofx.account.account_type) print("Account ID:", ofx.account.account_id)Thanks for the file! I can’t tell whether it was an artifact of how the ofx file you attached got created or whether the original ofx file suffers from this problem, but your ofx file is encoded in UTF-16 even though the header claims it’s UTF-8. ofxparse fails because of this. Running this allows it to work normally:
iconv -f UTF-16 -t UTF-8 fidelity_X12345678.ofx -o a.ofx ofx-summarize a.ofx Total number of accounts: 1You’re welcome, and glad to hear!
Found this if it helps.