Apologies, this is unreleased, bleeding edge code, and I should've warned 
that you're bound to run into these types of things. The fix for this one 
is simple: just add 'capgains_lt' and 'capgains_st' to your config. The 
updated example file shows how:
https://github.com/redstreet/beancount_reds_importers/blob/master/beancount_reds_importers/example/my.import

Optional: You might also want to pip3 install again (I just updated the 
example code), and run the example code, which should help as a reference 
for troubleshooting future issues.

I wouldn't be surprised if you ran into a couple more problems on this 
bleeding edge code: simply post here and I'll fix them.

Regarding the ofx file you just downloaded:
- is it named appropriately (includes 'fidelity' in the filename)?
- does it include transactions for the account number in your config? 
("grep <acc_num> fidelity.ofx" should tell you)

On Sunday, May 23, 2021 at 3:22:50 PM UTC-7 john.a.r...@gmail.com wrote:

> Hi, Red --
>
> Thanks very much for the prompt response.
>
> I installed the plug-in as instructed above, and unfortunately I've taken 
> a step back. Bean-identify still associates these files with my import 
> settings, but now I can't extract any files. Instead, I get this error 
> message:
>
> ERROR:root:Importer beancount_reds_importers.fidelity.Importer.extract() 
> raised an unexpected error: 'capgains_lt'
> Traceback (most recent call last):
>   File 
> "/Users/johnrakestraw/.pyenv/versions/3.9.1/lib/python3.9\\\\\\/site-packages/beancount/ingest/extract.py",
>  
> line 182, in extract
>     new_entries = extract_from_file(
>   File 
> "/Users/johnrakestraw/.pyenv/versions/3.9.1/lib/python3.9/site-packages/beancount/ingest/extract.py",
>  
> line 67, in extract_from_file
>     new_entries = importer.extract(file, **kwargs)
>   File 
> "/Users/johnrakestraw/.pyenv/versions/3.9.1/lib/python3.9/site-packages/beancount_reds_importers/libtransactionbuilder/investments.py",
>  
> line 311, in extract
>     self.initialize(file)
>   File 
> "/Users/johnrakestraw/.pyenv/versions/3.9.1/lib/python3.9/site-packages/beancount_reds_importers/libtransactionbuilder/investments.py",
>  
> line 45, in initialize
>     self.build_account_map()  # TODO: avoid for identify()
>   File 
> "/Users/johnrakestraw/.pyenv/versions/3.9.1/lib/python3.9/site-packages/beancount_reds_importers/libtransactionbuilder/investments.py",
>  
> line 57, in build_account_map
>     "capgains_lt": self.config['capgains_lt'],
> KeyError: 'capgains_lt'
>
> And there's a further mystery (at least, a mystery to me). I get this 
> error message on records I downloaded from Fidelity last night. (And, as I 
> said earlier, I successfully extracted transactions for two of my accounts 
> but not for the third.)
>
> The mystery is that I downloaded fresh files from Fidelity just now, after 
> getting that error message, using the same commands I used last night. But 
> bean-identify doesn't identify these using my my.import file and 
> bean-extract returns no error messages but instead merely the header -- ;; 
> -*- mode: beancount -*-.
>
> Why would it generate the error message with last night's files but not 
> even recognize the ones I just now downloaded? Makes no sense to me.
> On Sunday, May 23, 2021 at 3:52:08 PM UTC-4 redst...@gmail.com wrote:
>
>> Glad you find the importers helpful! 
>>
>> Thanks for reporting this. Someone else had a case of this too. Filed:
>> https://github.com/redstreet/beancount_reds_importers/issues/9
>>
>> Made a fix that should help. Could you please try re-running after:
>>
>> pip3 install git+https://github.com/redstreet/beancount_reds_importers
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/e413a867-5c33-4281-9388-74dd0ee68dfcn%40googlegroups.com.

Reply via email to