reckon icon indicating copy to clipboard operation
reckon copied to clipboard

[FEATURE REQUEST] Use ledger files as input source in addition to csv's

Open wakatara opened this issue 4 years ago • 3 comments

I started off 2021 trying to figure out how to automate my finances more (you get major credit for that in 2020 btw).

All my banks export QIF files to quicken which I can then get into ledger format via ledger tools' qif2ledger. Rather than use a csv file as the input for reckon, would it be possible to use a ledger file and then just write out a new ledger file based on the predictions the gem makes?

What I'm looking for is to be able to almost automate this pipeline eventually: script something that downloads all my bank files (though I doubt I can pull that off security wise), then do something like:

DumbBunny_bank_MMYYYY.qif > qif2ledger > reckon -f ./file_name_to_convert.ledger --currency 'SGD ' -l ~/Documents/ledger/2021_perso.ledger -o file_name_to_convertMMYYYY.ledger --suffixed

I imagine since you're already using the ledger format on output it should not be that tricky, but the value to me of the reckon gem is really the classification rather than the csv conversion, so having another input format would be aces. The conversion of my banks nonsense to csv actually takes more time whereas I'd assume if something was already in ledger format parsing it would be easy comparatively and really, as I said, the classification is the big value for me here (though I appreciate the fact I can get the csv's converted. It ends up being extra fiddling though.

(or the alternative might be just lift the conversion code for qif2ledger n and have it work that way... =p ).

Happy New Year!

wakatara avatar Jan 03 '21 06:01 wakatara

Happy new year @wakatara.

Automating your finances for 2021 sounds like a good resolution. I've been using selenium IDE in firefox to automate bank login and file downloads, but have more to do.

What if you used ledger to output the ledger file to csv and then used that file to pass to reckon?

Something like:

DumbBunny_bank_MMYYYY.qif > qif2ledger | ledger csv -f - > db_bank.csv
reckon -f db_bank.csv --currency 'SGD ' -l ~/Documents/ledger/2021_perso.ledger -o file_name_to_convertMMYYYY.ledger --suffixed

benprew avatar Jan 03 '21 07:01 benprew

Hehe... Had not thought that might work (though since my SG bank only provides xls downloads, I may be checkmated anyhow.). Lemme play around a bit and see.

D.

wakatara avatar Jan 03 '21 10:01 wakatara

Ahh, the dreaded .xls file.  I've used ssconvert (part of Gnumeric) to convert .xls files to .csv, but csvkit looks pretty good. But, there's a lot of ways to skin that cat :) Good luck.

benprew avatar Jan 05 '21 01:01 benprew