hledger, haskell
October 20, 2013

What is hledger ?

Continuing the introduction to hledger, today I’ll briefly describe what hledger is. I haven’t found a single perfect elevator pitch or definition yet, so here are several.

Are you… a normal person ? a ledger user ? a Haskell aficionado ? in a hurry ?

hledger for non-geeks

You might be new to accounting software, or perhaps you’ve used Quicken. hledger is a computer program for tracking your money on windows, mac, GNU/linux and other platforms. It has the same basic function as Quicken: you enter your financial transactions (or convert them from CSV or OFX), it remembers them and shows you account balances and other reports.

Unlike Quicken, hledger is not a graphical desktop app; you interact with it in a terminal/command window, or by using a web interface. Also hledger is developed by volunteers and provided for free under the GNU General Public License.

hledger for ledgerites

So you know ledger ? hledger is a friendly, co-evolving, compatible-where-possible rewrite of ledger in Haskell. hledger aims to provide the same core features while being a bit more simple, usable, installable, and documented. It can be extended with add-on commands.

hledger is not quite as fast as ledger on large data files, and it lacks some of ledger’s advanced features, such as generated entries, budget reports, fluctuating prices, and arbitrary value expressions and display formats.

hledger provides some new features, such as a web interface and assisted data entry, which can be useful for ledger users too. hledger’s file format is kept very close to ledger’s, so it’s relatively easy to use both programs on the same data files.

hledger’s use of Haskell helps reduce bug counts and maintenance costs, and also can make cross-platform deployment easier.

hledger for haskellers

You’re a keen Haskell programmer, or interested in Haskell. hledger is a Haskell rewrite of ledger, a double-entry accounting system based on text files and a command-line interface. It is among the first real-world Haskell applications which are used outside the Haskell world, like xmonad and Pandoc.

hledger can be used for tracking financial transactions, time logs, or anything that can be represented as dated numeric transactions. It provides:

  1. a reusable Haskell library (hledger-lib), including data types, parsers, reports and utilities
  2. a friendly command-line user interface (hledger), for generating reports and assisted data entry, which can be extended with add-on commands or scripts
  3. an alternate web interface (hledger-web), for reporting and data entry
  4. cross-platform ready-to-run binaries, although these are currently on hold

hledger for the impatient

You’re thinking: show me! Here’s how to track your financial transactions and account balances with hledger.

  1. save transactions in a file, ~/.hledger.journal by default, like this:
2013/10/18 mana foods      ; <- optional payee or transaction description
  expenses:groceries  $10  ; <- indented destination account, two spaces, an amount
  assets:checking          ; <- source account, $-10 amount is inferred if omitted

2013/10/19 another
  expenses:supplies  $20
  1. to see account balances, install hledger and run hledger balance:
$ hledger balance
                $-30  assets:checking
                 $30  expenses
                 $10    groceries
                 $20    supplies
  1. hledger add is another way to enter transactions, or you can convert CSV or OFX.
    hledger register ACCOUNT prints transactions affecting that account.
    hledger web starts the web interface, which has a demo.
    hledger by itself lists available commands, and the user manual explains them.