This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new!

Feature: Free Software

Ledger, the bran muffin of accounting tools

By Joe Barr on November 10, 2006 (8:00:00 AM)

Share    Print    Comments   

Ledger is a command-line accounting application for the hardcore financial professional. If you're an MBA who groks Emacs and regular expressions, or a kernel hacker who appreciates tax deferred accruals, you'll love this application.

The following description comes directly from Ledger's home page:

Ledger is an accounting tool with the moxie to exist. It provides no bells or whistles, and returns the user to the days before user interfaces were even a twinkling in their father's CRT. What it does offer is a double-entry accounting ledger with all the flexibility and muscle of its modern day cousins, without any of the fat. Think of it as the Bran Muffin of accounting tools.

Follow the link on the Ledger home page to grab the latest tarball. I needed to add the GMP and PCRE libraries in order to compile Ledger; your mileage may vary. Since I wanted to see how well it worked with GnuCash, I also had to specify --enable-xml and install the requisite XML libraries when configuring.

Ledger does not include a man page, but it does come with its own internal and external docs. For help, enter ledger -H, and prior to that, I recommend you spend some time perusing the manual, included in the tarball as ledger.pdf. For more help, subscribe to the mailing list or join the IRC #ledger channel at Freenode.

Ledger is simple. It's nothing more than a text-based ledger with lightning-fast query and reporting capabilities. All from the CLI, thank you very much. If you believe in Emacs, you'll celebrate the load library included in the download. Even if you're an infidel, using the vi editor, you're not forgotten -- there is a ledger.vim file included as well. Knock yourself out.

If you're not quite that hardcore, you can simply use whatever text editor you prefer: Gedit, for example. Or you can use no text editor at all, by keeping your books with GnuCash and using Ledger only to query and report.

The sample data included with the download gives you an idea of what the native Ledger source data looks like:

= /^Expenses:Books/
  (Liabilities:Taxes)             -0.10

~ Monthly Assets:Bank:Checking $500.00 Income:Salary

2004/05/01 * Checking balance Assets:Bank:Checking $1,000.00 Equity:Opening Balances

2004/05/01 * Investment balance Assets:Brokerage 50 AAPL @ $30.00 Equity:Opening Balances

2004/05/14 * Pay day Assets:Bank:Checking $500.00 Income:Salary

2004/05/27 Book Store Expenses:Books $20.00 Liabilities:MasterCard

2004/05/27 (100) Credit card company Liabilities:MasterCard $20.00 Assets:Bank:Checking

It looks easy enough, but I have to admit that after a very short while, I gave up on learning how to maintain the ledger in its native form. The call is yours, so long as you can endure the mocking tone of the documentation which describes the inanity of jointly using GnuCash and Ledger.

Enough of how to talk to Ledger -- let's see what Ledger can tell us.


Let's start with a couple of simple balance queries against the included sample data. If we enter ledger -f sample.dat bal, it recaps the ledger like this:

             50 AAPL  Assets
          $-2,500.00  Equity
              $20.00  Expenses
            $-500.00  Income
              $-2.00  Liabilities
             50 AAPL

If we're only interested in the balance of our checking account, we could enter ledger -f sample.dat balance Checking, and see this:

 $1,480.00  Assets:Bank:Checking

Need more detail? Try the register command instead of balance, like this one: ledger -f sample.dat register Checking:

2004/05/01 Checking balance     Assets:Bank:Checking      $1,000.00    $1,000.00
2004/05/14 Pay day              Assets:Bank:Checking        $500.00    $1,500.00
2004/05/27 Credit card company  Assets:Bank:Checking        $-20.00    $1,480.00

What if you only want to know the amount of a certain transaction? In that case, you can construct a query like this, which searches the ledger for entries on a specific date and a match for "Book" as payee:

ledger -f sample.dat 2004/05/27 Book
2004/05/27 Book Store
    Expenses:Books                            $20.00
    Liabilities:MasterCard                   $-20.00
    (Liabilities:Taxes)                       $-2.00

While I've covered only the simplest aspects of Ledger here, the fact remains that Ledger can and does do real accounting, including budgets, stocks, commodities, and extensive reporting including plots and graphs. Of course, all that is dependent upon you having a solid grasp of accounting, the CLI, and the Ledger application. For some, it's just right. One resident of the #ledger IRC channel on Freenode told me that he gave up Quicken for Ledger.

Share    Print    Comments   


on Ledger, the bran muffin of accounting tools

Note: Comments are owned by the poster. We are not responsible for their content.

Tool Time.

Posted by: Anonymous Coward on November 11, 2006 07:13 AM
"Ledger is a command-line accounting application for the hardcore financial professional."

I suspect the "hardcore" professional is hardcore somewere other than their tools.


What's the point of writing about CLI tools?

Posted by: Anonymous Coward on November 11, 2006 12:15 PM
Really, any application that uses the command line as its primary interface in 2006 is hopelessly anachronistic. Most people nowadays would refer to the command line as a user interface bug.


Re:What's the point of writing about CLI tools?

Posted by: Anonymous Coward on November 11, 2006 06:19 PM

I assume you're not programming in a text language then?

The command line, scripting, is just another language/line oriented tool to control the computer like python or ASP.NET. Sometimes it's use is appropriate, sometimes not.

GUI's are generally good at doing one off jobs anticipated by the GUI designer. They are poor at batch processing, tasks involving control logic and one-offs not anticipated by the GUI designer.


Thanks for this!

Posted by: Anonymous Coward on November 12, 2006 10:07 AM
As much as people make a big stink about how CLI tools are too hard to grok, there are still those of us who can recognize when they can be more useful or efficient than a GUI counterpart. I'm not so hardcore as to do my entries using this software, but I'm thrilled at its speed, reporting/querying power (using regex), and it's simplicity.

I will continue to actually record my GL entries in GnuCash, but Ledger is a fantastic supplementary tool for sure. Thanks for pointing me towards it!



Posted by: Anonymous Coward on November 11, 2006 08:40 AM
I'm overwhelmed. So, in order for me to save $200/year on Quickbooks, all I have to do is spend a few months learning esoteric commands and budget all of my bookeeping to take at least 4 times as long as it currently does? Wow! I'm excited about this stellar product!

Where can I find more products that will help me waste even more money, even faster?



Posted by: Anonymous Coward on November 11, 2006 08:46 AM
If you don't like it, fine, but I use Ledger and I enter transactions and get the data I need much quicker than I ever could with GUI apps, and with much less aggravation, and from any box with an ssh client.



Posted by: Anonymous Coward on November 11, 2006 01:16 PM
The point is not to save money on Quickbooks.

Common sense will tell you that if you don't have to point and click, and doesn't use the all the system resources that Quickbooks and Windows use, it will be much faster. Not slower.

This software (which you call a "product" as if someone were trying to sell it to you) is for people who like the command line. It is not meant for retarded Windows addicts like yourself.



Posted by: Anonymous Coward on November 12, 2006 12:34 AM
what a retard. if you don't see the point here, then you're not a command line user... so why waste your time reading something that your pea-size brain can't make sense of, and waste ours with your useless comments?

The poster of this comment is obviously a troll and an idiot



Posted by: Anonymous Coward on November 12, 2006 12:37 AM
You might have a point with that time is money.

But maybe you are not in the intended audience?
Maybe this is not a accounting software for mortals?

Maybe this is a hackers choice of accounting tool.<nobr> <wbr></nobr>:)


Re:Wow. Double Wow, for even less!

Posted by: Joe Barr on November 12, 2006 01:47 AM

You sound like the perfect candidate for Vista to me.


Re:Wow. Double Wow, for even less!

Posted by: Administrator on November 13, 2006 11:13 AM
WOW! and that's for the number of flames in this thread.<nobr> <wbr></nobr>;)


Well -

Posted by: Administrator on November 11, 2006 10:10 PM
Actually, in my experience most professionals use programs with no less obscure keyboard shortcuts and often non-intuitive structure.


info page

Posted by: Anonymous Coward on November 11, 2006 08:48 AM
Ledger doesn't have a man page, but there is an extensive set of info pages included (figures, seeing as the author loves emacs.)


gnuCash ?

Posted by: Anonymous Coward on November 13, 2006 07:41 AM
how do you use gnuCash files ??
tried<nobr> <wbr></nobr>./ledger -f gnucash-file
but get errors...


Re:gnuCash ?

Posted by: Anonymous Coward on November 18, 2006 12:03 AM
You need to gunzip the GnuCash data file if you keep it compressed. Then Ledger can use it. There is an option in GnuCash that determines whether you keep the file compressed or not.

Oh. And always use forums like this for support questions. Never the mailing list or any intended forum.


GUI are not always more efficient

Posted by: Anonymous Coward on November 13, 2006 04:32 PM
I've been involved years ago (MS-DOS) with an accounting application: the GUI was nice and perfectly usable, still, the users favored a no GUI version. Because, in their case, the GUI was slower to use than typing direct codes/values!

Basically they used things like "Mnc=10.5, GBRM=88975.50, etc". As they were experts in their field and already used codes with ink and paper, and used their applications all day long, it was in fact faster than "spending" time navigating throught the GUI.

So, in some specific cases, a GUI might not be that necessary...

Of course, a beginner would never have been able to use the no-GUI version, hence the 2 modes.


Bingo! Re:GUI are not always more efficient

Posted by: Anonymous Coward on November 14, 2006 12:04 AM
a keyboard interface will (90%) always be faster than a mouse controled interface.

- Keyboard offers 112'ish keys vs two buttons and a wheel
- Keyboard functions at the speed of thought and finger dexterity not visual hunt and peck screen tracking
- Transfering one hand from keyboard (typing input) to mouse (pick next form filed perhaps?) and back is an inherent inefficiency

If your a gammer, consider a comparison of mouse/keyboard games vs console games. five to ten button controler with cramp causing bizar hand possitions for advanced control vs a mouse for target/view and the other hand using all maped keys available on the keyboard based on your natural hand possition.

But that also leads to where a mouse control gui is more efficient than a keyboard input only system = games. Well, image editing and mouse-only functions within gui programs such as spreadsheet autofilters.

Last, I can run a non-gui OS such as linux on a 486 or pent120 with 64 megs of ram and get as good if not better performance from the hardware/OS with as many if not more functions than Dos/Win16/Win32 OS and damn near as much functionality as X and a window manager (gui linux for the newbies).

Most gui functions are skins over terminal accessible commands anyhow for both efficiency of development (same reason we all like libaries) and transparent administration across a network be it lowly modem or latest fiber.

But what do I know


Re:Well -

Posted by: Administrator on November 13, 2006 04:09 AM
Indeed. Traders (who don't have time to lose) use things like Bloomberg that's awash with codes. Granted the application is graphical but not the navigation.



Posted by: Administrator on November 15, 2006 03:02 AM
It's 100% command line oriented, which is good for those who run text-only systems.



Posted by: Administrator on November 14, 2006 11:52 PM
Hi there. I just came across this article. I find it complicated though although it offers ledgers and double entry bookkeeping. What makes it far different from other accounting tools such as peach tree, simply accounting, etc. Hope to get a reply. Thank you.


This story has been archived. Comments can no longer be posted.

Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya