ledger-autosync icon indicating copy to clipboard operation
ledger-autosync copied to clipboard

Feature request: option to store raw OFX

Open emin63 opened this issue 5 years ago • 3 comments

I have a feature request: allow an option to store the raw OFX.

For example, if you do ledger-autosync --account <some_acct> --storeraw /path/to/raw.ofx then it would be nice if l-a could store the raw OFX data that it downloads in /path/to/raw.ofx. This is helpful for debugging and also helpful if l-a does something not quite right with the OFX. For example, I am still having some problems with fees and commissions. It would be nice if I could run l-a with the --storeraw flag to store the raw OFX it gets and then reprocess that OFX later when I find/fix bugs.

What do you think?

Thanks, -Emin

emin63 avatar Aug 03 '20 03:08 emin63

I think this is a great idea! ledger-autosync will sometimes make multiple requests, so there might be multiple files, and I'm not 100% sure you can access the raw, unprocessed OFX using ofxclient easily. But I think it's a great idea. Unfortunately I probably don't have the time to work on this in the near future.

egh avatar Aug 03 '20 04:08 egh

I agree, this would definitely be useful, and it also would save me the extra step of downloading backup OFX files after running ledger-autosync.

The multiple requests / files is fair, but I'd be fine with that.

If I'm reading the code right, the initial download is returned as a string, and it's not until a couple lines later that it's parsed into a Python object, so it should be possible to dump it to a file before that.

501st-alpha1 avatar Aug 04 '20 04:08 501st-alpha1

If I'm reading the code right, the initial download is returned as a string, and it's not until a couple lines later that it's parsed into a Python object, so it should be possible to dump it to a file before that.

Your reading looks correct to me! Sorry for the misinformation; it's been a while since I worked on that cod.e

egh avatar Aug 04 '20 05:08 egh