Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Good import and export functions / library in Go Lang for ledger-cli?

10 views
Skip to first unread message

Daryl Manning

unread,
Mar 12, 2025, 1:21:00 PM (11 days ago) Mar 12
to Ledger
Heya plain-texters,

TLDR

Does anyone have or know of any robust ledger import / export libraries in Go Lang? I've written something for my portfolio use cases, but was hoping for something more generalizable.

The Longer Tale

So, I've been tracking my portfolio for about 5 years in ledger (and which made things very easy to reconcile when there was a diff between my brokerage and my records.). Quite happy with it as a longer term format that works well internationally and across borders.

Long story short, I'm working on a Go app (for personal consumption though will probs release open source at some future point. Early days still.) to track, screen, rebalance, alert, and trade around EMT, but of course, my source data (and referred archival format) is in ledger.

I just wrote a parser and exporter to handle the ledger files and accounts/stocks as I've been tracking them. Loads into the app database (and exports nicely), but I'm kinda parsing/exporting on a 3-line header, asset, and cash line model for each transaction stanza.

Does anyone have more robust import and export libraries in Go lang they use and are well and battle tested (with actual tests).

A google/chatGPT did not turn up any usable Go library for ledger with stocks, particularly where multiple currencies were involved.

thanks!
Daryl.
PS> Happy to post up what I've got here btw if it's at all helpful to anyone (and an example of what my ledger file and database transactions model look like.



Reply all
Reply to author
Forward
0 new messages