
Command Line, Console and UI Based Open Source Plain Text Accounting - golanggeek
http://hledger.org
======
marvinpinto
Related to this, I wrote a CLI tool called Ledger Reconciler[0] to automate
the process of logging into all my financial accounts and inputting those
transactions into Ledger. It uses headless Chrome underneath (via the
puppeteer API[1]) so it could theoretically work with any system without
needing to rely on public/private banking APIs.

I also tried to make the plugin system as friendly as I could so people for
people to add their own financial instutions. I'm optimistic someone will
contribute a plugin one day :)

[0]: [https://disjoint.ca/projects/ledger-
reconciler](https://disjoint.ca/projects/ledger-reconciler)

[1]:
[https://github.com/GoogleChrome/puppeteer](https://github.com/GoogleChrome/puppeteer)

~~~
jimbokun
How do you handle authenticating to the financial institutions?

~~~
sly010
I think we all know the answer to that question :)

I would note that professional bank feed apis (e.g. yoodle) also use username
password pairs and not only break when you change password but can result in a
locked bank account due to too many retries.

That said, there is no universal solution in the US.

~~~
kreetx
> I think we all know the answer to that question :)

May I ask-- for those not in the know --that what is it? :) From your comment
I'd infer that username/password, but that hasn't been the case for many
years, at least at the banks I use (in Europe).

~~~
stedaniels
If he's using headless Chrome then it's likely form filling. I.e. just
automatically typing in the answers to the authentication prompts on the pages
as you'd normally do when you log in. Most banks, even those with TOTP or
alternate MFA methods, allow you to login with standard authentication details
to get access to statements and not make any changes.

------
rjzzleep
Does anyone have any advice on how to be successful with ledger? I've tried a
few things. I entered a lot of things, but the issues I have are more
structural nature and probably general lack of accounting experience:

What types do you use is there a useful list, that I can then translate to SMB
or Personal tax filing? A somewhat standardized structure of assets,
liabilities, accounts payable, accounts receivable etc.

How do you deal with Cash? (EDIT: most answers assume that you only spend
little cash, but in some countries cash can account for a decent amount of
your income)

How do you deal with interest?

How do you keep your bank statements? I've tried using
[https://github.com/johannesgerer/buchhaltung](https://github.com/johannesgerer/buchhaltung)
which supports paypal ofx and hbci

How do you convert your balance sheet into a tax filing compatible format?

How do you track things like rent? Do you keep it as a recurring entry i.e. `~
Monthly` or do you only book it when you pay with buchhaltung?

Do you keep completely separate ledger files if you're sole proprietor or can
you keep them semi separate and work with includes to create separate reports
for private and sole proprietor tax filing?

How do you track small expenses on the go? There's a web app called fava from
beancount which looks nice, but i'm not sure you want to expose it to the
outside world and i'm not sure the files are fully compatible with hledger
[https://beancount.github.io/fava/](https://beancount.github.io/fava/)

Any help would be greatly appreciated.

~~~
matthiasv
> How do you deal with Cash?

Move money from Asset:Checking to Expenses:Cash

> How do you deal with interest?

Move money from Income:Interest to Asset:Depot

> How do you keep your bank statements?

I download CSVs once in a while an import them with hledgers import tool (see
[https://bloerg.net/2016/02/22/ledger-import-of-deutsche-
bank...](https://bloerg.net/2016/02/22/ledger-import-of-deutsche-bank-
data.html))

> How do you convert your balance sheet into a tax filing compatible format?

I don't, sorry. But it's actually pretty easy to get the relevant data if you
split your taxable incoming accordingly.

> How do you track things like rent? Do you keep it as a recurring entry i.e.
> `~ Monthly` or do you only book it when you pay with buchhaltung?

It's part of the bank statement, so yes it moves money from Assets:Checking to
Expenses:Rent whenever the transaction happens.

> How do you track small expenses on the go?

I don't. After a while I found it's not worth the effort. I rarely make
financial decisions based on how much I spent on beers and sandwiches, so most
of these little things are just subsumed in Expenses:Cash.

~~~
gglitch
> > How do you deal with Cash?

> Move money from Asset:Checking to Expenses:Cash

I've been moving from Assets:Checking to Assets:Cash, and then from
Assets:Cash to Expenses:Haircuts (or whatever)

~~~
egh
You can also move from Assets:Checking to Expenses:Cash, and then from
Expenses:Cash to Expenses:Haircuts. This allows you to track the larger cash
expenses if you like, while letting the small purchases accrue in
Expenses:Cash.

~~~
gglitch
I just found that workflow described in a blog post elsewhere too:

"Pro-tip: tracking cash withdrawals and purchases can be a pain. I typically
just maintain an Expenses:Cash account for these sorts of things. If I can
remember how I spent a bit of cash, great: I can just debit Expenses:Cash and
credit the appropriate account for what I spent the cash on after the fact.
Otherwise, I just leave the amount attributed to Expenses:Cash. It's often not
worth the trouble of trying to keep finer track of cash purchases than that."
\-- [http://matthewturland.com/2014/03/29/ledger-basics-and-
habit...](http://matthewturland.com/2014/03/29/ledger-basics-and-habits/)

Sounds smart, though at the scale of my personal finances, I get much more
value out of tracking the petty transactions. I guess I'm pound-wise but
penny-foolish.

------
sleavey
I use GnuCash [1] with non-compressed save files enabled so that I can store
changes on Git. It works flawlessly for me: I can edit accounts across
different computers, get the full force of a mature accounting package to do
my finances, and can use/write scripts that plot some statistics using various
bindings (e.g. Python) [2].

[1] [https://gnucash.org/](https://gnucash.org/)

[2]
[https://github.com/SeanDS/gnucashxml](https://github.com/SeanDS/gnucashxml)

~~~
wgreenberg
Have you found a sane way to handle massive initial imports? As far as I can
tell, there's no way to bulk-categorize transactions. That means I'd have to
go through each of my 6k+ transactions one-by-one for categorization.

~~~
sleavey
Not sure - I moved to GnuCash with only a few hundred transactions to import,
so I did it manually. It may be possible to use the search tool to find the
transactions you want to give a particular category to, and then categorise
all of those (I'd be surprised if there wasn't a way to bulk categorise a list
of transactions).

------
arca_vorago
This is very impressive! I have a SO pursuing accounting, and there are so
many subpar proprietary systems in the accounting world it's crazy. I have
used gnucash, but there are many issues with gnucash that text only systems
like ledger address, but the learning curve for them is daunting to your
average user. So I could definitely see great opportunity for a text based
ledger system and all its benefits along with a GUI overlay.

All that, with a gplv3 license, this is the kind of project I can get behind!

------
jasonkostempski
I've been trying to replace the last dependency I have on Google products, a
"finacial forecast" Spreadsheet integrated with Calendar. It lets me see
approximately how much cash I'll have on hand at future dates, basically
letting me live paycheck to paycheck without too much stress :) Can this do
something like that? If not, does anyone know of something with similar
features (local program, simple data files, etc.) that can?

~~~
howeyc
I don't see why not, if you're willing to get deep into the ledger file
format. Look at "Forecast" and "Budgeting."

[http://plaintextaccounting.org/](http://plaintextaccounting.org/)

Integrated right into your calendar, I don't know about that part.

~~~
sevensor
> Integrated right into your calendar, I don't know about that part.

Depends on the calendar -- surely it could be integrated with cal(1).

~~~
jasonkostempski
integrating with cal would be perfect. I'm going to look into this as soon as
I can.

------
jdemler
At CurrySoftware GmbH we use ledger + recutils + aqbanking + custom bash
scripts to automate many business processes.

Some of these processes are required by german law and many companys outsource
these to accountants or tax advisors or buy shitty software from DATEV.

The great advantage in staying fully plaintext is, that you do not need to
automate everything for the whole system to work. Incoming invoices are
frequent -> write a bash script, Outgoing invoices are frequent -> write a
bash script. Paying the state back some VAT happens once a month, use emacs to
do it manually. I really love it.

~~~
levosmetalo
It would be interesting if you could share your workflow/scripts.

Especially how did you implement SKR03 (guess you use that) into your hledger
account hierarchy, and how do you generate e.g monthly VAT reports, or yearly
VAT and trade tax reports.

~~~
jdemler
The system is not yet ready to be published but drop me a mail and I will send
you some bash scripts and will try to answer questions.

We use a custom "Kontenrahmen" based on the same ideas as SKR03, as using
numbers is not necessary with ledger. That also means we can only communicate
with tax advisors through paper. But as we communicate with the Finanzamt
directly, thats ok.

------
narendraj9
[https://github.com/narendraj9/hledger-
mode](https://github.com/narendraj9/hledger-mode)

I have been using this for almost two years now. I am not sure if there are
any other users but I find it very convenient. (Disclaimer: I wrote the
extension).

~~~
golanggeek
Thats awesome, to use it with emacs

------
yegle
I've been using beancount for the last 3 years. The fava project provides an
awesome web UI for beancount and I'm really happy with that.

~~~
mapleoin
I've been using ledger for years. I really wanted to give beancount a try, but
keeping documentation in google docs aggravates me. I understand that it might
be easier for the writers to write and keep up to date. But it's an absolute
pain to read/browse/skim/search, which is the whole point of documentation.

------
LVB
I successfully switched to ledger a few years ago after a few failed attempts
years earlier. I attribute success to:
[https://github.com/quentinsf/icsv2ledger](https://github.com/quentinsf/icsv2ledger)

It is the transaction import script that has really worked well for me without
quirks. A lot of people recommend "reckon"\--which I've tried--but I found
that while Bayesian scoring sounds good, a solid set of regex work better.
icsv2ledger does a great job of allowing you to build up a pool of search
terms to map inputs to categories. And since the regex set is an artifact that
you can tweak and add to, you end up with a very stable and comprehensive
import process.

I also like that it will (optionally) add the raw CSV that was imported as a
comment in the transaction, and use that to avoid reimporting transactions.
While this is a little visually noisy in the ledger file, I'm blind to it by
now and it makes it rock solid to reimport CSV files without fear of
duplicates. This also provides a neat way of dealing with each side of a
transaction coming in separately. For example, both my checking and credit
card list the transaction that corresponds to me paying my bill, but that is
only one transaction in the ledger file. After I've done the import of
everything, I simply delete one of the new entries but first copy its CSV
comment into the remaining remaining transaction. So one ledger transaction
lists both CSV comments, and subsequent imports from either account are
duplicate free.

------
Loic
This looks like a very well done project. If you are more a traditional
software kind of person, I recommend heavily KMyMoney[0]. I have my full
family accounting since 2007 in it (every single income/expense) and it works
flawlessly allowing me with the great reports to know exactly where our family
money is spent and saved.

[0]: [https://kmymoney.org/](https://kmymoney.org/)

------
megous
I've tried using ledger in the past. I ended up moving all the data to a
database. Ultimately it is much easier/flexible to work with SQL, than
arbitrary command line tools. Also it's easier to manipulate and process the
data from anywhere (psql, cli app, web app, ...), without fear of corruption.

~~~
matthiasv
How do you model double-entry book-keeping in your relational database? And
where comes the fear of corruption if .ledger files are merely text?

~~~
megous
I can't share everything here, but basics are this. Three tables: accounts,
transactions, entries. Entries have amount, unit, notes. Accounts have name,
parent_account. Transactions have subject, notes, date. That's the data. Then
I have a view that flattens accounts tree, so that each has name and fullname.
Name being Fun, fullname a full path to that account, eg. Expenses:Fun.

With that base structure, you can start answering any questions by just
summing entries groupped by accounts filtered by a regexp on fullname and
fitler on date. What is my cashflow for any time period, what is my equity,
what is my balance sheet, what I actually have, what changed recently, how any
of this develops over time...

------
clircle
Are there any plain text accounting systems that provide an android app as
well? I'm using gnucash, mostly because it has a nice companion app.

