New to ledger - how to ease in from gnucash?

1,209 views
Skip to first unread message

ngoone...@gmail.com

unread,
Nov 10, 2016, 1:06:48 PM11/10/16
to Ledger
I'm looking at ledger, hledger, and beancount (slight preference for the last as my python is better than my C), and before I test it out I've a few questions.

1. Import from gnucash, I think that's only available for ledger and only for an older version? Is the syntax incompatible? I've got 5+ years of records in gnucash that I'd want to keep.

2. Mobile entry (from a phone). I'm currently using a simple budget/accounting type app to note down transactions and then manually copying it whenever I'm at my computer. Or I'll just say "I'll remember to do this when I get back to the office" only to forget and have to reconstruct my records from receipts. I think hledger and beancount have web UIs, are those usable on phones when out and about (I do have a home raspberry pi which can host it)?

3. Sync of the ledger - I've read comments about using dropbox (simple enough), but what about automatic git-based sync (with merges etc.)? Are there tools to accomodate that?

4. Editing/entry - I've seen emacs recommended, but I'm a vim guy myself. Which of the three options has auto-completion of accounts/categories for vim users (or should I just be using it from the shell)?

Thanks, sorry for the questions which I'm sure most here would have heard many times before, but I can't seem to find reliable answers to the above.

John Wiegley

unread,
Nov 10, 2016, 1:11:39 PM11/10/16
to ngoone...@gmail.com, Ledger
>>>>> "nt" == ngoonee talk <ngoone...@gmail.com> writes:

nt> 1. Import from gnucash, I think that's only available for ledger and only
nt> for an older version? Is the syntax incompatible? I've got 5+ years of
nt> records in gnucash that I'd want to keep.

You could certainly use Ledger 2 for a one-time export of your GnuCash data.
Then you can use any of the three tools after that.

nt> 3. Sync of the ledger - I've read comments about using dropbox (simple
nt> enough), but what about automatic git-based sync (with merges etc.)? Are
nt> there tools to accomodate that?

You could use "git-annex" as a git-based auto sync:

https://git-annex.branchable.com/

--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2

ngoone...@gmail.com

unread,
Nov 11, 2016, 2:54:30 AM11/11/16
to Ledger, ngoone...@gmail.com, jo...@newartisans.com
On Friday, November 11, 2016 at 2:11:39 AM UTC+8, John Wiegley wrote:

You could certainly use Ledger 2 for a one-time export of your GnuCash data.
Then you can use any of the three tools after that.

Thanks, that'd be one-way though. I suppose I could give it a month of entering in two systems to see how I get along with ledger. I understand hledger is mostly syntax compatible, beancount isn't though?
 

nt> 3. Sync of the ledger - I've read comments about using dropbox (simple
nt> enough), but what about automatic git-based sync (with merges etc.)? Are
nt> there tools to accomodate that?

You could use "git-annex" as a git-based auto sync:

    https://git-annex.branchable.com/

Thanks but there doesn't seem to be much automated about git-annex. dvcs-autosync seems more suitable, but its mostly dead (I still use it myself in a legacy manner though).

Simon Michael

unread,
Nov 11, 2016, 11:00:32 AM11/11/16
to ledge...@googlegroups.com, hle...@googlegroups.com
On 11/10/16 12:16 AM,
ngoone...@gmail.com wrote:
> 1. Import from gnucash, I think that's only available for ledger and only
> for an older version? Is the syntax incompatible? I've got 5+ years of
> records in gnucash that I'd want to keep.

There's also eg gnucash2ledger.py, see
http://plaintextaccounting.org/#data-importconversion

> 2. Mobile entry (from a phone). I'm currently using a simple
> budget/accounting type app to note down transactions and then manually
> copying it whenever I'm at my computer. Or I'll just say "I'll remember to
> do this when I get back to the office" only to forget and have to
> reconstruct my records from receipts. I think hledger and beancount have
> web UIs, are those usable on phones when out and about (I do have a home
> raspberry pi which can host it)?

I've heard of a few people doing this. I don't think hledger-web was
usable on small screens before, but hledger-web 1.0 should be.

Another option would be to use some native phone app with a good data
entry UI and CSV export. iXpenseit Pro was one I used in the past.

> 3. Sync of the ledger - I've read comments about using dropbox (simple
> enough), but what about automatic git-based sync (with merges etc.)? Are
> there tools to accomodate that?

None that have been shared, as far as I remember.

> 4. Editing/entry - I've seen emacs recommended, but I'm a vim guy myself.
> Which of the three options has auto-completion of accounts/categories for
> vim users (or should I just be using it from the shell)?
>
> Thanks, sorry for the questions which I'm sure most here would have heard
> many times before, but I can't seem to find reliable answers to the above.

I see vim modes at http://plaintextaccounting.org/#editor-support which
I would think provide that for all three.



Simon Michael

unread,
Nov 11, 2016, 11:10:50 AM11/11/16
to ledge...@googlegroups.com, bean...@googlegroups.com
On 11/10/16 11:54 PM,
ngoone...@gmail.com wrote:
> On Friday, November 11, 2016 at 2:11:39 AM UTC+8, John Wiegley wrote:
>
>>
>> You could certainly use Ledger 2 for a one-time export of your GnuCash
>> data.
>> Then you can use any of the three tools after that.
>>
>
> Thanks, that'd be one-way though. I suppose I could give it a month of
> entering in two systems to see how I get along with ledger. I understand
> hledger is mostly syntax compatible, beancount isn't though?

beancount is more different but still pretty close, it's not too hard to
convert it by search-replace/emacs macro/sed script. I think beancount
must also have a tool for importing ledger format.

(Obligatory pta.o link) This syntax comparison may be useful if you
haven't already seen it:

http://plaintextaccounting.org/quickref


Oon-Ee Ng

unread,
Nov 11, 2016, 7:33:10 PM11/11/16
to ledge...@googlegroups.com, bean...@googlegroups.com
Well, as I haven't started using any the significance of those
differences aren't obvious to me (yet) =)

Manuel Amador (Rudd-O)

unread,
Nov 13, 2016, 2:52:57 PM11/13/16
to ledge...@googlegroups.com
On 11/11/2016 07:54 AM, ngoone...@gmail.com wrote:
>
> You could use "git-annex" as a git-based auto sync:
>
> https://git-annex.branchable.com/
> <https://git-annex.branchable.com/>
>
> Thanks but there doesn't seem to be much automated about git-annex.
> dvcs-autosync seems more suitable, but its mostly dead (I still use it
> myself in a legacy manner though).

Use syncthing. It's available for Android and for Linux.


--
Rudd-O
http://rudd-o.com/

Oon-Ee Ng

unread,
Nov 13, 2016, 8:36:51 PM11/13/16
to ledge...@googlegroups.com
That's basically dropbox, isn't it? The concern there would be what
happens if two devices modify the ledger at the same time.

Oon-Ee Ng

unread,
Nov 24, 2016, 11:12:05 AM11/24/16
to ledge...@googlegroups.com
So as an update, I did a gnucash to ledger conversion and took a look
with hledger, general accounts seem fine.

However running ledger2beancount.py produced what looks like a valid
beancount file, except I got TONS of Invalid account names. Reading up
a bit it seems beancount has 5 'base' account types, and is more
strict in this regard that ledger (and gnucash).

I have regular backups of my gnucash accounts, and am not averse to
modifying them to fit the beancount model. What I am averse to is
jumping straight in and abandoning a system I use daily with a
conversion which isn't repeatable. Anyone have any experience/ideas on
what to do? Would it be sufficient for me to (in gnucash) move
everything to Equity etc. base accounts?

Martin Blais

unread,
Nov 25, 2016, 1:50:10 PM11/25/16
to ledger-cli
On Thu, Nov 24, 2016 at 6:12 AM, Oon-Ee Ng <ngoone...@gmail.com> wrote:
So as an update, I did a gnucash to ledger conversion and took a look
with hledger, general accounts seem fine.

However running ledger2beancount.py produced what looks like a valid
beancount file, except I got TONS of Invalid account names. Reading up
a bit it seems beancount has 5 'base' account types, and is more
strict in this regard that ledger (and gnucash). 

The issue may simpler than this; it may just be that the conversion script you use doesn't output an Open directive for each account. Beancount is pedantic by default; it requires that you declare all the accounts before you use them (and also allows you to close them).

If you like, you can also use a plugin that auto-declares all the accounts for you.
At the top of the file, try adding

  plugin "beancount.plugins.auto_accounts"

This might get rid of the problem you're seeing.
(If the problem is the root accounts, read below.)

 

I have regular backups of my gnucash accounts, and am not averse to
modifying them to fit the beancount model. What I am averse to is
jumping straight in and abandoning a system I use daily with a
conversion which isn't repeatable. Anyone have any experience/ideas on
what to do? Would it be sufficient for me to (in gnucash) move
everything to Equity etc. base accounts?

Which root accounts you have?

You can customize the names of your root accounts.
See the name_* options in

If you have other root accounts, you could also choose a particular category for them, or if you feel that no category is a fit, put them under Equity: ... ; ultimately, choosing one of the four (Assets, Liabilities, Income, Expenses) categories allows you to build balance sheets and income statements, it's good practice. If you need help selecting a category, feel free to email the group.



Oon-Ee Ng

unread,
Dec 22, 2016, 4:19:44 PM12/22/16
to ledge...@googlegroups.com
On Sat, Nov 26, 2016 at 2:49 AM, Martin Blais <bl...@furius.ca> wrote:
> On Thu, Nov 24, 2016 at 6:12 AM, Oon-Ee Ng <ngoone...@gmail.com> wrote:
> If you like, you can also use a plugin that auto-declares all the accounts
> for you.
> At the top of the file, try adding
>
> plugin "beancount.plugins.auto_accounts"

Nope, as expected this isn't my issue.

>> I have regular backups of my gnucash accounts, and am not averse to
>> modifying them to fit the beancount model. What I am averse to is
>> jumping straight in and abandoning a system I use daily with a
>> conversion which isn't repeatable. Anyone have any experience/ideas on
>> what to do? Would it be sufficient for me to (in gnucash) move
>> everything to Equity etc. base accounts?
>
> Which root accounts you have?
>
> You can customize the names of your root accounts.
> See the name_* options in
> http://furius.ca/beancount/doc/options
>
> If you have other root accounts, you could also choose a particular category
> for them, or if you feel that no category is a fit, put them under Equity:
> ... ; ultimately, choosing one of the four (Assets, Liabilities, Income,
> Expenses) categories allows you to build balance sheets and income
> statements, it's good practice. If you need help selecting a category, feel
> free to email the group.

I have the following root accounts
Banking
Cash
Equity
Expenses
Expired Accounts (due to how gnucash shows accounts, I move closed
accounts here so they still balance but aren't in my main view)
Income
Investments
Loans

More than five, so do I have to reshuffle things in gnucash? As I
understand it, this is how it'd look:-
Assets <- Banking, Cash, Investments, Expired Accounts
Equity <- Equity
Expenses <- Expenses
Income <- Income
Liabilities <- Loans

My assumption is that I can't have multiple
option "name_assets" **
lines?

Martin Blais

unread,
Dec 22, 2016, 11:07:45 PM12/22/16
to ledger-cli
In Beancount you could just leave those where they are; you can mark accounts as closed on a particular date with a Close directive and the reporting won't include the account if the reporting period doesn't overlap with its lifetime.

 
Income
Investments
Loans

More than five, so do I have to reshuffle things in gnucash? As I
understand it, this is how it'd look:-
Assets <- Banking, Cash, Investments, Expired Accounts
Equity <- Equity
Expenses <- Expenses
Income <- Income
Liabilities <- Loans

That seems sensible to me.

You should probably rejigger your account names in your conversion scripts instead of messing with your Gnucash input, that's probably safer (my experience with Gnucash is that it's so brittle that anything unusual will break it, so I won't suggest you try).


 
My assumption is that I can't have multiple
option "name_assets" **
lines?

Nope.
 
Reply all
Reply to author
Forward
0 new messages