ledger importer?

139 views
Skip to first unread message

Alen Šiljak

unread,
Feb 8, 2025, 6:59:54 AMFeb 8
to Beancount
Hi all!

Would you have any recommendations for a Ledger-cli importer? Martin used to maintain ledger2beancount and I'm wondering if that is still the case and if it is up-to-date with v3 of Beancount. 
Otherwise I might spend some time and try to adapt it.

I have some time on my hands and would like to delve again into migrating years of ledger data into Beancount format and trying it out.
I'm really keen on contributing to the project (when I have some time), for example by adapting Cashier to output a compatible format, or expanding its functionality with items supported in Beancount.

Cheers,

Alen

Martin Blais

unread,
Feb 8, 2025, 7:03:44 AMFeb 8
to Beancount


On Sat, Feb 8, 2025, 06:59 Alen Šiljak <goo...@alensiljak.eu.org> wrote:
Hi all!

Would you have any recommendations for a Ledger-cli importer? Martin used to maintain ledger2beancount and I'm wondering if that is still the case and if it is up-to-date with v3 of Beancount. 

I'm not. I'm not sure if it still works. 



Otherwise I might spend some time and try to adapt it.

I think that will be an easy project.



I have some time on my hands and would like to delve again into migrating years of ledger data into Beancount format and trying it out.
I'm really keen on contributing to the project (when I have some time), for example by adapting Cashier to output a compatible format, or expanding its functionality with items supported in Beancount.

Cheers,

Alen

--
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+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/beancount/3d2ac953-a946-423f-9107-d0e3311dd342n%40googlegroups.com.

Stefano Zacchiroli

unread,
Feb 8, 2025, 7:42:33 AMFeb 8
to bean...@googlegroups.com
On Sat, Feb 08, 2025 at 03:59:54AM -0800, Alen Šiljak wrote:
> Would you have any recommendations for a Ledger-cli importer? Martin used
> to maintain ledger2beancount and I'm wondering if that is still the case
> and if it is up-to-date with v3 of Beancount.

Ledger2beancount works pretty well, I use it daily with both v2 and v3.
Some adaptations to v3-specific syntax are still missing and tracked
here: https://github.com/beancount/ledger2beancount/issues/260 . Patches
welcome!

Cheers
--
Stefano Zacchiroli . za...@upsilon.cc . https://upsilon.cc/zack _. ^ ._
Full professor of Computer Science o o o \/|V|\/
Télécom Paris, Polytechnic Institute of Paris o o o </> <\>
Co-founder & CSO Software Heritage o o o o /\|^|/\
Mastodon: https://mastodon.xyz/@zacchiro '" V "'

Martin Michlmayr

unread,
Feb 8, 2025, 8:01:43 AMFeb 8
to bean...@googlegroups.com
* Alen Šiljak <goo...@alensiljak.eu.org> [2025-02-08 03:59]:
> Would you have any recommendations for a Ledger-cli importer? Martin used
> to maintain ledger2beancount and I'm wondering if that is still the case
> and if it is up-to-date with v3 of Beancount.
> Otherwise I might spend some time and try to adapt it.

ledger2beancount is pretty feature complete as far as I'm concerned,
although there are a number of outstanding issues, including some
minor v3 updates (as Zack pointed out).

I'd definitely appreciate feature requests, bug reports and patches.
Your feedback might prompt me in fixing the remaining outstanding
issues.

--
Martin Michlmayr
https://www.cyrius.com/

Alen Šiljak

unread,
Feb 8, 2025, 9:15:00 AMFeb 8
to Beancount
Guys, thanks for the quick feedback! I'll be trying these tools again today.

Martin Michlmayr

unread,
Feb 8, 2025, 8:29:16 PMFeb 8
to bean...@googlegroups.com
* Martin Blais <bl...@furius.ca> [2025-02-08 07:03]:
> > Would you have any recommendations for a Ledger-cli importer? Martin used
> > to maintain ledger2beancount and I'm wondering if that is still the case
> > and if it is up-to-date with v3 of Beancount.
>
> I'm not. I'm not sure if it still works.

You're probably referring to beancount2ledger (rather than the
ledger2beancount Alen asked about).

FWIW, I did some work on beancount2ledger when it was split out of
beancount and I was planning on maintaining it but in the end I never
used ledger and beancount in parallel as much as I expected to, so I
don't really have a personal need for beancount2ledger anymore.

I'm not sure if beancount2ledger works with beancount v3. That's
somewhere on my TODO list.

If someone on this list cares about beancount2ledger, contributions
would be welcome!

Simon Michael

unread,
Feb 23, 2025, 8:01:22 PMFeb 23
to bean...@googlegroups.com
Alen, if you can get your ledger journal into hledger, recent hledger
will do a pretty good job of converting it to a valid beancount journal.
Eg, perhaps:

ledger print | hledger -f- -I print -o foo.beancount


I forget what specific problems I hit with ledger2beancount. But
generally, it's not easy to make a robust ledger to beancount converter
because Beancount's syntax is much less permissive than Ledger's.
https://hledger.org/1.41/hledger.html#beancount-output
discusses most of the conversion issues I found and worked around
(a few more are not yet handled).

Simon Michael

unread,
Feb 23, 2025, 8:11:04 PMFeb 23
to bean...@googlegroups.com
On 2025-02-23 15:01, Simon Michael wrote:
> Alen, if you can get your ledger journal into hledger, recent hledger
> will do a pretty good job of converting it to a valid beancount journal.
> Eg, perhaps:
>
> ledger print | hledger -f- -I print -o foo.beancount
>
>
> I forget what specific problems I hit with ledger2beancount. But
> generally, it's not easy to make a robust ledger to beancount converter
> because Beancount's syntax is much less permissive than Ledger's.

(Also, because third party converters are never as good at reading
Ledger's complex journal format as Ledger itself.)


Alen Šiljak

unread,
May 4, 2025, 7:30:36 AMMay 4
to Beancount
Thanks for pointing this out, Simon!
I'm back to trying to convert the ledger this weekend and am hitting some issues with porting lot sales with ledger2beancount.
hledger is giving me other issues. I guess I have to consolidate the syntax in my ledger files first. The older data was ported from GnuCash by some other script, I believe.
Reply all
Reply to author
Forward
0 new messages