Thanks for the suggestion, Stanko. While I _could_ do that, it would make
automation more difficult for what I want to accomplish in the future, and adds a
level of indirection, so much more inclined to attempt correct parsing
directly (also, I want an import/export function for the app). Have used
csv in the past though as I do make use of the (excellent) reckon ruby
gem to ML my category entry though from bank csv files, but this is a
different animal here.
Perhaps a better approach, is I just share
what I've got and ask anyone if they believe they can improve it or to
critique it. I've thrown the Go code up on a public github gist at:
https://gist.github.com/wakatara/45022740c2167517defd0ddc1eadb506for both the import/export and the transaction model (please feel free to shoot holes in the txn model too)
(I definitely know I've benefitted from people just sharing snippets and entire code before - ie. ledger-pyreport)
The
code kinda expects transactions to be in the following format atm to
parse for FX, symbols and currencies. I use a no-fee broker so fixed
costs aren't coded in atm though that needs to be folded in as well.
2020-02-02 CAD-hedged S&P 500 Growth ETF Limit Buy
Assets:SPYG 100 SPYG @ 49.8396 USD
Assets:CA:Cash -6661.30 CAD @ 0.74822297 USDciao!
Daryl.