Hledger has a more sane query language, but its not as powerful as ledger's. Also probably less bugs than ledger. Ledger, however, lets you do pretty much anything you want and thats why i prefer it. of course its easier to make mistakes with it, but i prefer the freedom it offers.
My ledger file works in both ledger and hledger, I tend to mostly use ledger as it's worked better within emacs for me. It's very rare that I even have to use the CLI. Ledger's docs are great.
Can hledger be run in a Haskell repl? That sounds way more useful than a command line terminal. (Otherwise I'm not sure why it matters whether it was written in Haskell?)
My favorite part of the (extensive) Haskell API is `Hledger.Cli.Script` [0]. It re-exports all the most commonly used functions and data types, meaning you're just one import away from everything you need to get started.
>Otherwise I'm not sure why it matters whether it was written in Haskell?
It's a common trope with less popular languages. Often when I check out some project on GitHub, the first "feature" in the readme is "written in rust".
A key advantage of hledger, and why I migrated from ledger, is that hledger internally orders transactions chronologically, whereas ledger inexplicably orders them in the order they appear int he file, irrespective of the date attached to them.
This [ledger's approach] totally breaks the ability to break different transaction types into different files and then import all files into a master file.
You can get this behavior with --sort d in argument or ledgerrc or setting LEDGER_SORT=d in your environment. Or merge files sorted by date with ledger -f file1 -f file2 --sort d print. I agree the default sorting is quite jarring, but practically every single time if some entry is out of place chronologically, for me it's because I input-ed the wrong date and the default sort makes more sense. The reason I have hledger installed is for check ordereddates.
My solution is to pick the file names in such a way that `include *.ledger` imports them in the right order (you need the latest version of ledger for that to work, in older versions the order was indeterminate)
ledger has a few powerful features that hledger lacks, for example in ledger you can create an "assert" statement that checks all your journal entries fall in the correct time period (easy to mess up if you copy/paste journal entries). But it's pretty easy to move between the two.
R is pretty good to boot, and has been around since the 1990s too. I would’ve said that Excel is the assembly of data manipulation and dplyr is the command line. The higher level of abstraction and the guardrails help.
I feel like GNUCash splits the difference. You still get a GUI and reporting tools, but you also get the benefit of local reasoning that double entry accounting provides: as long as every transaction is balanced the entire book is balanced. And the data model supports transactions between more than two accounts, which is extremely useful.
My preferred backend is SQL based, so it's a relatively amenable to inspection and custom tooling.
For my own personal stuff I do just use spreadsheets. Copy paste and some super hacky SQL queries, done. Double entry bookkeeping is total overkill for most people's home budgeting.
I do use ledger if it's for other people's money though, cus the liability of getting things wrong is higher.
I know that US finance is a bit behind but in Europe you can get a bank account with a nice app and even separate that into different pots or accounts free of charge.
My bank automatically classifies expenses and you can of course export to csv for further analysis.
I have two virtual debit cards one for personal and one for business stuff so all of the stuff ledger does is fully automatic.
Don't know about how it is in the US but what I enjoy about banks here is that basically all of them offer FinTS/HBCI/PSD2 or some other API to interact with the account so you can have a nice desktop app that automatically pulls info from all your accounts without ever having to interact with each banks online banking interface.
But you can’t use PSD2 APIs as an individual (at most banks), so if you want to use it, you necessarily have to entrust your financial data to a third party.
The problem happens when you get more accounts of different types. Currently, I have around 40 accounts in ledger for me and my family. Multiple bank accounts, multiple brokerages, loans, tax optimization accounts, pension, etc.
Some institutions have a good tools and some not regardless of country. I recall using european NyKredit was pain as much as bank of America.
Ledger (or hledger in my case) helps to build structured “meta view” while still keeping my data private (from one vendor).
I try to keep a smallest possible amount of accounts and consolidate similar accounts. However, in reality there are many types of accounts and you can’t merge them.
Sometimes accounts of same type in same country can’t be merged. I have a very stupid example: I’m unable to close Robinhood account because I own a few YNDX shares that I can’t sell or transfer. So I have it just hanging there (but excluded from my ledger)
Fine if you have a couple of cash accounts with one bank. What if you have other assets like stocks/shares, property etc.? What if you want to track shared expenses with friends/family and settle up at the end of each month? You can do this kind of thing with ledger.
> What if you want to track shared expenses with friends/family and settle up at the end of each month?
I agree with your overall sentiment, but for that specific use-case, there are tons of apps where everyone in the group can see, add, and edit the transactions live, and then square up later.
When I lived in a shared house at university, we used Splid [1], which is very easy to use yet supports advanced features like multiple currencies. If you ever find yourself needing to split expenses, I can highly recommend it.
Ok but how do you track what those expenses were? From the point of view of your bank account you were just paying "shared expense". I want to know what it was, groceries, energy etc.
You track it in your shared expenses app (e.g. Splid). When you enter an expense, you enter the amount, a description, and the persons in the group who are splitting that expense.
For example, let’s say Anna, Bill and Josh start a group. Anna buys groceries, so she enters the following transaction: 30 EUR, groceries, paid by Anna, applies to {Anna, Bill, Josh}.
Then, Anna, Bill and Josh can all see (on their own phone) that transaction in the transaction log, and they can also all see that Anna’s balance is 20 EUR, and Bill and Josh both have a balance of -10 EUR.
Then, let’s say Bill and Josh go for coffee, Bill enters: 10 EUR, coffee, paid by Bill, applies to {Bill, Josh}. Then the balances become: Anna 20 EUR, Bill -5 EUR, Josh -15 EUR.
So the nice part is that because everything is synced, everyone in the group can easily add transactions and see the transaction log and balances, all from their own phone.
> all of the stuff ledger does is fully automatic.
Does your track all your loan liabilities to the penny, or how much interest accrued on your mortgage? Does it know when the rent is due and provide you a forecasted minimum balance in your checking account? Since you mentioned "business stuff": does it know the difference between an expense and an asset?
There's a time in life where simple works, but as your net worth grows "my bank handles all that" will become less and less true.
I like the idea of plaintext accounting and have tried a few of these options a number of times, sometimes pretty earnestly, but have never landed on a satisfactory flow. I've always ended up spending quite a lot of time building out the tooling around trying to fetch from now more than a dozen accounts and then munge/categorize things acceptably. In the end, I just fall back to pressing "Download All Accounts" in the clunky-but-serviceable Moneydance (local data FTW).
I have the same issue, but in Europe. Most bank don't offert a data export, so it's fun an games to try to get YOUR data. In Belgium we have CODA for companies... but they're slightly different for each bank. I've worked on this for a middleman and it's hell, between the source data sucking and the destination being cryptic.
I don't understand this: why would anyone want to block this? There are no advantages. None. For either party.
Double entry accounting is the original immutable event architecture.
They call out that it is hard to learn, but most of that in my experience is because people don't realize that credit cards and debit cards.
Just remember the formula:
Assets= liabilities + capital
It may be counterintuitive at first, but keeping that formula true is the requirement.
Debits on the left and are positive
Credits on the right and are negative.
Using Excel and a cash basis has killed lots of companies where customers pay for services and products, which looks like income, while the related expenses haven't been paid for.
It took a second for me because I'm accustomed to people talking about Assets and Liabilities to describe the picture, so the equation in my head is the inverted one:
It's standard for accounts that normally maintain a debit balance be on the left side, and accounts that maintain a credit balance be on the right.
So, the usual accounting equation is written:
assets = liabilities + capital
Yes, capital is similar to liabilities. It is owed to the investors (which may just be an individual).
The full equation prior to closing the books for a period is:
assets + expenses = liabilities + income + capital
For an individual, 'capital' is usually called 'net worth'.
Once the books close, (income - expenses) is moved to capital as 'retained earnings'.
In traditional, hand entered debit/credit accounting, the left hand side adds up to the same number as the right hand side. The books are balanced - the accounts on the left 'weigh' the same as the ones on the right.
In computerized accounting, the left hand side (debit) accounts are normally positive and the right hand side (credit) accounts are normally negative. There is no equation - all the accounts add up to zero, and every double entry transaction adds up to zero.
Ah, now it's clear. Some of the other long-winded responses unhinged my thought train into wondering if accounting uses some kind of atypical or asymmetrical equation system. So, no; it's an equation, and it's simple.
I think in the US we usually call Capital "Equity", so it's
Assets = Liabilities + Equity
Or net assets = equity.
The corollary for an accounting period
Assets + Expenses = Liabilities + Equity + Income
is more interesting. We say that the left side has a debit balance and the right side has a credit balance. It's easy to see how a few transactions work.
Pay a bill from checking, debit Expenses, credit Assets.
Buy something on credit card, debit Expenses, credit Liabilities.
Receive a payment for services, debit Assets, credit Income.
To close the accounts for the period, credit total Expenses to 0, debit Equity by that amount, and debit total Income to 0 and credit Equity by that amount.
Naturally, things are kept in subaccounts but this is the overall effect on the accounting equation.
Accounting for computer scientists is a good read. it presents double entry accounting in a way that should be more familiar to us, as a graph theory problem.
Sometimes non-accounting people get hung-up on the words "debit" and "credit" and think they have to do with "owing" or "being owed" money, being "positive" or "negative", etc.
The effect of a debit or credit on the business depends on the accounts in the transaction and debit and credit don't have anything to do with the "direction" of a flow of money.
My 100-level accounting instructor summarized it as: "A debit is the entry in the left column, and a credit is an entry in the right column." Without the context of the specific accounts being debited or credited the terms themselves don't confer significant meaning.
A basic knowledge of bookkeeping and accounting terminology can confer near "super powers" when it comes to dealing with finance people. It's easy to learn and worth the time.
Double-entry bookkeeping is one of the oldest and longest-practiced "IT" disciplines. Your work probably touches revenue / expenses for your employer and someday you'll need to interface with accounting or finance people. Being able to speak the language, even poorly, has helped me gain trust and credibility that I don't believe speaking only in IT terms would have.
I do wish accounting practice would finally accept the mathematical advancements of the last 500 years and start using negative numbers. Combined with the "transactions sum to zero" rule it makes things blindingly obvious.
Background: I studied the basics of accounting on 8th and 9th grade, and acted as a treasurer or auditor in some university student associations. I accepted the traditional presentation as a given; "it'll make sense in the end".
Then I learned the negative number thing and the sums-to-zero concept and suddenly it was completely clear what was happening. Ledger manual's "Principles of Accounting with Ledger" was where this finally kicked in.
I think all these tutorials and showcases showing CLI usage for plaintext accounting kinda miss the mark and ultimately hinders adoption. 99% of the times I interact with ledger is with the same 4 commands. The fact I have the ledger file open in emacs and use these commands from a keybind is what makes the experience great. Trust me, if you need to run some complicated analysis, (h)ledger has your back and you can find how to do it in the docs. Most of the time you don't so just go and start bookkeeping. You need your file populated to see any benefit, and they'll become obvious when you get there.
Do you have a good guide to start that you could recommend? It sounds quite simple when you mention it, but every time I tried to get started with Ledger with or without emacs, it always seemed too much of an undertaking and stalled pretty early... if you have a good workflow to recommend, that would be very helpful.
You don't need a lot of commands to use Ledger successfully. 99% of the time, I only use one (`ledger bal`). The main thing is how to put stuff in your ledger file (and in fact, I devote most of the book to that). And, of course, the discipline to do it regularly (which I outsource to Beeminder).
My brain quickly gets bored with any attempt to "track" myself, even if it's finance. If you're like that, I'd advise you to first make concrete how you're gonna use the result -- which report-commands you'll bind to keys, and how the reports are gonna influence your decisions. Only then start tracking.
I use hledger only for the things I want reports of (taxes, utilities etc split with spouse, money spent on specific hobbies, etc; not restaurants etc). Entering everything into ledger is mind-numbingly boring.
Outside of automatic git hooks for validation, I really only run hledger when reconciling balance with spouse or when reporting taxes.
I've been using Ledger for years now and with thousands of entries a year. I track investments, income, expenses, and budgeting. For mobile entry, I keep my ledger file on Dropbox and use the Drafts app and TextExpander on my iPhone to quickly append properly formatted ledger entries to the file from my phone, the moment the expense occurs. Every two to four weeks, I spend 10 minutes and use ledger-mode in Emacs to reconcile accounts with online bank / credit card transactions. It works really well and I love the flexibility and long-term portability of keeping my ledger in plain-text.
Sure! Here's what I do to add an expense from my phone:
1. Open the Drafts App on my iPhone.
2. Type "lfood", which triggers TextExpander with my ledger food expense snippet [1]. I make use of the TextExpander fill-ins feature [2] to automatically set the current date and to give me a list of dropdowns that I can use to change the account, but usually I just leave the default and only fill in the expense amount.
3. Enter the expense amount, select the credit card that I used from a dropdown if it's different from the default.
4. Trigger the 'Save to Ledger' action [3] that I created within the Drafts app [4], which appends the ledger entry to my ledger file on Dropbox.
I created a short gif [5] showing this entire process in action.
Been using ledger and hledger for about four years, love them dearly. I find ledger + Emacs ledger-mode the most convenient for daily use. Hledger has a somewhat nicer way of formatting reports on the CLI, making it useful for creating ad-hoc reports and digging into your data.
I've been using hledger[1] - similar tool but has more features like balance sheet, income statement generation with a plain text file for the last 3 years and it's been working out great. Before that I used iBank (rebranded as Banktivity) and don't miss it at all.
Not really, I don't do much in excel anymore, And I probably should not be giving advice as I have no classical training in accounting. But the ledger docs have a pretty great introduction to basic accounting theory. It is not too difficult to apply this theory into whatever data storage engine you are using.
That simple schema fails to represent split transactions. I went the superstore and bought groceries, computer gear, and a new battery for the car. Oh and my spouse handed me a $100 bill to cover some of the cost.
Yes, a simplified schema like that fails to capture the entire semantics of a transaction. However, I find for personal finance I never need full transaction semantics and simplified two party semantics are much easier to enter and calculate.
I will be honest, I use ledger and I like how it can express the complex transaction, however I also have to admit that I have never used them. If I were storing my finance data in a relational database or a spreadsheet, I would be very tempted to use the simplified two party model. I probably would not actually do it, but when I am elbow deep in code making sure to handle N-Party transactions correctly, I would be tempted.
The author of the plain text accounting system(PTA) went with this simplified model and made a good case for it, one line per transaction is much easier to parse, for both the human reading them and the machine. note that PTA does support split transactions but they are the special case.
Just started using it last month. Used Mint until a year or two after Intuit bought it, then basically did no real budgeting until my recent GnuCash use.
A few YouTube vids made the interface less daunting and I read a few Reddit comments on how people use it themselves, and I'm applying what I can to my own setup.
If there's anything a new GnuCash user should read or learn, please let me know!
The main problem is that I don't want to give a third party access to my bank accounts, so importing into gnucash is (1) download pdf statements from bank (2) use python scripts I wrote to convert to csv (3) use gnucash importer to import.
This is fairly painful stuff, more so because my bank statements are all generated on different days of the month. So I can't form a habit of doing this regularly enough to make the data useful.
Welcome to Canada. The checking/saving account statement is in csv. The credit card statements are only provided as pdf by my bank. That's where most transactions are.
I recently started using Ledger this year, and I've been really impressed with its utility for me. I think, for my personal needs, https://pypi.org/project/ledger-autosync/ is a must-have. I don't want create my own transactions, and with the autosync extension, I can simply export my bank transactions as QFX files and then import them into my ledger file. In the past, I struggled to accurately track my spending, and typical banking apps were either slow or lacked good querying capabilities. Now, I can easily budget, track purchases, calculate my worth across multiple accounts, and more.
I guess similar results might be possible with other accounting tool but Ledger perfectly meets my requirements. Also, it integrates pretty well with Emacs and I get to check my reports from there.
Lmao I wrote my own csv translator using regex, because I thought this was a paid feature of stuff like Plaid only. You’re a lifesaver! How do you download your statements though? That’s still a small sticking point for me, and it sounds like you still need to individually go to each bank and pull each statement. Maybe I just have too many credit cards lol
It looks like ledger-autosync isn't very good at guessing what accounts to use. I wrote my own machine learning thing to do that. However my scripts are a hodgepodge with manual work required. I wonder if I could integrate the machine learning aspect into autosync...
Shameless plug – last year I published a short ebook teaching the principles of personal accounting using Ledger: https://leanpub.com/personal-accounting-in-ledger. In fact, I've been using Ledger for about 10 years now (earlier GnuCash), and I like it a lot.
I've been using ledger for years, quite happily. My setup includes a whole lot of custom code for downloading transactions from my banks, PayPal etc and classifying them automatically. I use Ledger as the storage format and to generate reports. I find it simple, pretty easy to learn and powerful.
The only thing I'm really missing are custom fields, I slam a lot of information about transactions into comments.
I've just done the same thing. My inputs are CSV files from all over the place, and the output is a ledger file. Driven by make, of course. :)
Processing the CSVs takes about one second per year of my data, so what I think I'll probably do is summarize it out to ledger format each year.
I was using awk to do the CSV parsing, and it's blazing fast. But it gets a little bit unwieldy if you have to do multiple passes through a file or if a single CSV file has multiple sections. So I moved them to Python which is far more capable, but slower.
I use a Makefile as well :D Both to glue it all together and for the most common reports I need. For turning the CSV files into Ledger, I have a binary written in Common Lisp. Suppose I tried to make accounting exciting and it worked :P
I love how this thread immediately filled up with all the accounting nerds on the site. Good to see you all again!
I’ll do my part and throw in what I believe is the most popular modern take on this, beancount. I ended up going back to ledger but if the super old school interface and stack bother you, beancount might be nicer. Plus the beancount docs are just out-of-this-world good for learning double-entry accounting in general.
I’ve been using beancount for almost 1.5 years now, and other than having to explicitly open accounts I love it! I use the fava UI to have all the nice modern visuals: https://beancount.github.io/fava/
beancount user here, I remember starting with ledger/hledger and then switching to beancount because of its nicer handling of investments (as in nicer towards the user); the "Philosophical Differences" highlighted in the docs reminded me of why I switched — and then there is fava which is cool to start with
Allow me to gush about ledger for a moment -- I've been using it exclusively for my small business accounting for the past 3 years and it's absolutely spectacular and has been life-changing.
For many years I suffered through QuickBooks because I just assumed that was the Only Way. The single biggest pain point (and it's hard to pick just one) is that QuickBooks makes it absolutely mind-numbingly difficult to bulk-change any entries in your ledger -- if you categorize 1000 items one way and your accountant later tells you to recategorize them, there is NO WAY (or at least there was no way when I did this in the early 2000s) to bulk recategorize items. So I remember the pain of having to manually change thousands of entries or, worse, doing indecipherable things like making single journal entries like "moving from X category to Y category".
Discovering ledger was a breath of fresh air because the source data is just text! If you need to change data or recategorize or make any tweaks whatsoever you have the entire world of text manipulation tools at hand. You can write shell scripts and use IDEs (and believe it or not Github Copilot works REALLY well).
It's just amazing to realize that the perfect accounting solution has been there the whole time and is vastly vastly SIMPLER than I ever imagined. I went through all the SaaS tools (Xero, etc.) and nothing felt right. Ledger just works and feels right.
I generally despise having to do double entry bookkeeping in the first place, but when I do (in some situations you have to), I use ledger (or hledger). Way less painful than QuickBooks if you're also a programmer or adjacent.
> and believe it or not Github Copilot works REALLY well).
And yes, this is one area where LLM can help. That valley between "manually duplicating these near identical entries is painful" and "but it's not painful enough to warrant a custom generator". LLM is often great for that kind of boilerplate. Gotta doublecheck the bejesus out of it though.
I started setting up hledger this year and I’m with you for a small business it is absolutely great.
Some notes:
- The initial setup of the books is pretty time consuming especially if you have a lot of accounts. I recommend starting your most important accounts and adding as you go along.
- Mass changing categories is just a search and replace so I have been getting pretty fine grained with the categories as I go along.
- Being a small business the separation from business and personal is needed from a legal standpoint, but from a practical standpoint I live off an owner’s draw and a put cash into the LLC when investing in its growth. Having hledger have all my accounts, personal and business and being able to filter out appropriate reports has been great for seeing things like is the business a money pit or am I actually growing wealth over time.
- I combine hledger csv output with Jupyter to generate the specific reports and charts I need. I.e business specific versus combined for taxes. This filtering also has me thinking of other ideas like figuring out which credit cards to apply for based on my expenses.
Overall more fine tuned than what I have been able to achieve with Quickbooks over 8 years.
What's your plan if you need to share the books with someone else (tax authority, accounting firm, etc)? Can ledger export it some industry-standard format that will let you share this information?
Or, at the end of the day is the default interchange format in this space just CSV?
Is there even an industry standard format? I've been dumping CSV to my accountant and I plan on doing the same for the tax authority if they came knocking.
Something tells me they can't be too picky about such things. My experience with the tax authorities in three countries now tells me they'll take whatever odd format data you hand them.
There is not. Financial accounting is built on random csv-ish formats and pure brute force. Half the time we can't even agree on using the same date format within the same dataset. One of our banking partners even require macros (yes, excel vba macros) to be enabled for their data to make sense. It's madness, but if you want to make money, you can't be picky with the data formats.
> SAF-T Financial is a standard format used in the exchange of accounting data. SAF-T, or Standard Audit File-Tax, is the result of a joint development collaboration between the business community, the accounting sector and the Norwegian Tax Administration, based on a recommendation by the OECD.
My business is over 15 years old by now and our ledger use has grown to encompass 7 different currencies and multiple corporate entities (by calling ledger with different includes we can generate a combined ledger across entities, very nice, try doing that with one of those online tools).
So at some point you are going to have to deal with an accountant who will not typically know what ledger is. The solution is actually very simple: we wrote a small ruby script that generates an excel file that contains a balance and profit and loss statement in a format they are familiar with. That's the cool think about everything being text based, it's really easy to pipe the ledger output into a script and into a gem that generates an Excel file and add some styling.
The raw journal files are also in a format accountants can easily comprehend, they didn't actually look at those in our case, but if they want to know where the Excel comes from they are welcome to audit them.
> I suffered through Quickbooks because I just assumed that was the Only Way
Suffering through QuickBooks is literally a product feature. Like, when they were porting it to the online version, bookkeepers got upset that the web version didn’t have many of the frustrating quirks of the desktop version that they’d spent decades learning to deal with. They see their having learned the bizarre ins and outs of the software as a moat that keeps their clients from doing their books themselves, so many/most require their clients to use it. And Intuit is far more responsive to the interests of CPAs/bookkeepers than it is to the end users who pay for it.
Source: I worked in Intuit’s SBG and was really surprised when I heard that from some of the product people. I’m so used to being user-focused and searching out ways to be more user friendly that it never occurred to me that, in a 3-sided market, making the software hostile to the user could be a selling point.
A while back I switched over to using SQLite, a bunch of Python functions for munging and dBeaver as a makeshift GUI. My main focus is tax reporting rather than budgeting.
The best my (awful) banks seem to be able to manage is old-fashioned CSV exports, so there’s little benefit from having something with the ability to call out to an API or import (US) standardised file formats.
Anyone else doing it this way? Seems to be going pretty well so far and of course doesn’t require learning a new query language. I’m sure there’s a lot more to (h)Ledger than that, though.
I've been using hledger for two years now, and I don't use any exported data from my banks. Here's my workflow:
Everytime I make a transaction, I put a note on my phone. The note is a simplified version of hledger file format. Example:
24feb
12.5 cash food eating out at xx
6.5 bank1 phonebill
25feb
...
and so on. As you can see, each block is started with the date, and each line corresponds to a journal entry. In each entry, the first item is the dollar amount, the 2nd item is the credited account, the 3rd item is the debited account, and the rest will be taken as the entry description.
Every week end, I will parse this note with a Python script that I wrote, and put the output in the actual journal file. The shorthand account names in the note will be converted into actual account name (e.g. 'bank1' to 'assets:bank:bank1'), based on a dictionary file.
I'd then proceed to manually check that all ending balances in hledger match with the actual amount in the real world. (It's pretty satisfying to see the numbers match.)
After I've finished processing the note from my phone, that note will be archvied and I will start with a new note.
I used to do this. But now I only register cash expenses. The rest I rely on the bank to keep track of transactions and just use hledger csv rules to create ledger journals. I find it more convenient and since I deal with many bank accounts, I can check the balance on each bank report.
124 comments
[ 4.7 ms ] story [ 198 ms ] threadComparison of the two: https://hledger.org/ledger.html
I'm trying to start using hledger.
[0]: https://hackage.haskell.org/package/hledger-1.32.3/docs/Hled...
It's a common trope with less popular languages. Often when I check out some project on GitHub, the first "feature" in the readme is "written in rust".
This [ledger's approach] totally breaks the ability to break different transaction types into different files and then import all files into a master file.
Includes a list of similar software and ports and their current status (active/inactive).
Throw away all other software, you don’t need any of that.
Excel is the worst thing ever happened to data scientists.
If sciencist knew awk/perl + gnuplot and basic C, most of the errors would't happened.
From HN: Scientists rename human genes to stop MS Excel from misreading them as dates
https://news.ycombinator.com/item?id=24070385
My preferred backend is SQL based, so it's a relatively amenable to inspection and custom tooling.
I do use ledger if it's for other people's money though, cus the liability of getting things wrong is higher.
My bank automatically classifies expenses and you can of course export to csv for further analysis. I have two virtual debit cards one for personal and one for business stuff so all of the stuff ledger does is fully automatic.
For Mac for example, this one is very nice: https://apps.apple.com/de/app/moneymoney/id872698314?l=en
Sometimes accounts of same type in same country can’t be merged. I have a very stupid example: I’m unable to close Robinhood account because I own a few YNDX shares that I can’t sell or transfer. So I have it just hanging there (but excluded from my ledger)
I agree with your overall sentiment, but for that specific use-case, there are tons of apps where everyone in the group can see, add, and edit the transactions live, and then square up later.
When I lived in a shared house at university, we used Splid [1], which is very easy to use yet supports advanced features like multiple currencies. If you ever find yourself needing to split expenses, I can highly recommend it.
[1] https://splid.app/english/
For example, let’s say Anna, Bill and Josh start a group. Anna buys groceries, so she enters the following transaction: 30 EUR, groceries, paid by Anna, applies to {Anna, Bill, Josh}.
Then, Anna, Bill and Josh can all see (on their own phone) that transaction in the transaction log, and they can also all see that Anna’s balance is 20 EUR, and Bill and Josh both have a balance of -10 EUR.
Then, let’s say Bill and Josh go for coffee, Bill enters: 10 EUR, coffee, paid by Bill, applies to {Bill, Josh}. Then the balances become: Anna 20 EUR, Bill -5 EUR, Josh -15 EUR.
So the nice part is that because everything is synced, everyone in the group can easily add transactions and see the transaction log and balances, all from their own phone.
Does your track all your loan liabilities to the penny, or how much interest accrued on your mortgage? Does it know when the rent is due and provide you a forecasted minimum balance in your checking account? Since you mentioned "business stuff": does it know the difference between an expense and an asset?
There's a time in life where simple works, but as your net worth grows "my bank handles all that" will become less and less true.
They call out that it is hard to learn, but most of that in my experience is because people don't realize that credit cards and debit cards.
Just remember the formula:
Assets= liabilities + capital
It may be counterintuitive at first, but keeping that formula true is the requirement.
Debits on the left and are positive Credits on the right and are negative.
Using Excel and a cash basis has killed lots of companies where customers pay for services and products, which looks like income, while the related expenses haven't been paid for.
Lol, that'd be nice! I think you'll want to edit that.
Because the accounting equation has been the same for centuries.
Assets = Capital + Liabilities
https://www.accaglobal.com/gb/en/student/exam-support-resour....
Capital = Assets - Liabilities.
I can imagine GP had a similar confusion.
A - L = P
We put it on the right side to say that was the Owners value.
I never knew why they insisted on that but now I do.
So, the usual accounting equation is written:
assets = liabilities + capital
Yes, capital is similar to liabilities. It is owed to the investors (which may just be an individual).
The full equation prior to closing the books for a period is:
assets + expenses = liabilities + income + capital
For an individual, 'capital' is usually called 'net worth'.
Once the books close, (income - expenses) is moved to capital as 'retained earnings'.
In traditional, hand entered debit/credit accounting, the left hand side adds up to the same number as the right hand side. The books are balanced - the accounts on the left 'weigh' the same as the ones on the right.
In computerized accounting, the left hand side (debit) accounts are normally positive and the right hand side (credit) accounts are normally negative. There is no equation - all the accounts add up to zero, and every double entry transaction adds up to zero.
Assets = Liabilities + Equity
Or net assets = equity.
The corollary for an accounting period
Assets + Expenses = Liabilities + Equity + Income
is more interesting. We say that the left side has a debit balance and the right side has a credit balance. It's easy to see how a few transactions work.
Pay a bill from checking, debit Expenses, credit Assets.
Buy something on credit card, debit Expenses, credit Liabilities.
Pay credit card, credit Assets, debit Liabilities.
Receive a payment for services, debit Assets, credit Income.
To close the accounts for the period, credit total Expenses to 0, debit Equity by that amount, and debit total Income to 0 and credit Equity by that amount.
Naturally, things are kept in subaccounts but this is the overall effect on the accounting equation.
Accounting for computer scientists is a good read. it presents double entry accounting in a way that should be more familiar to us, as a graph theory problem.
Sometimes non-accounting people get hung-up on the words "debit" and "credit" and think they have to do with "owing" or "being owed" money, being "positive" or "negative", etc.
The effect of a debit or credit on the business depends on the accounts in the transaction and debit and credit don't have anything to do with the "direction" of a flow of money.
My 100-level accounting instructor summarized it as: "A debit is the entry in the left column, and a credit is an entry in the right column." Without the context of the specific accounts being debited or credited the terms themselves don't confer significant meaning.
A basic knowledge of bookkeeping and accounting terminology can confer near "super powers" when it comes to dealing with finance people. It's easy to learn and worth the time.
Double-entry bookkeeping is one of the oldest and longest-practiced "IT" disciplines. Your work probably touches revenue / expenses for your employer and someday you'll need to interface with accounting or finance people. Being able to speak the language, even poorly, has helped me gain trust and credibility that I don't believe speaking only in IT terms would have.
If you get paid $1000, your Income account gets -1000 and your Checking account gets +1000.
Background: I studied the basics of accounting on 8th and 9th grade, and acted as a treasurer or auditor in some university student associations. I accepted the traditional presentation as a given; "it'll make sense in the end".
Then I learned the negative number thing and the sums-to-zero concept and suddenly it was completely clear what was happening. Ledger manual's "Principles of Accounting with Ledger" was where this finally kicked in.
https://ledger-cli.org/doc/ledger3.html#Principles-of-Accoun...
PTA sign convention makes it very straightforward:
If the posting amount is negative it's a credit
If the posting amount is positive it's a debit.
I use this mnemonic:
debit / to / plus / left / short words
credit / from / minus / right / longer words
Pick one particular "zone" of finances (eg: monthly bills) and track only that part of it for a while.
You'll figure it out!
You don't need a lot of commands to use Ledger successfully. 99% of the time, I only use one (`ledger bal`). The main thing is how to put stuff in your ledger file (and in fact, I devote most of the book to that). And, of course, the discipline to do it regularly (which I outsource to Beeminder).
https://ledger-cli.org/doc/ledger3.html#Keeping-a-Journal
Outside of automatic git hooks for validation, I really only run hledger when reconciling balance with spouse or when reporting taxes.
1. Open the Drafts App on my iPhone.
2. Type "lfood", which triggers TextExpander with my ledger food expense snippet [1]. I make use of the TextExpander fill-ins feature [2] to automatically set the current date and to give me a list of dropdowns that I can use to change the account, but usually I just leave the default and only fill in the expense amount.
3. Enter the expense amount, select the credit card that I used from a dropdown if it's different from the default.
4. Trigger the 'Save to Ledger' action [3] that I created within the Drafts app [4], which appends the ledger entry to my ledger file on Dropbox.
I created a short gif [5] showing this entire process in action.
[1] https://i.imgur.com/NXEimql.png
[2] https://textexpander.com/learn/using/snippets/advanced-snipp...
[3] https://i.imgur.com/LNDJNGi.png
[4] https://docs.getdrafts.com/actions/
[5] https://ibb.co/vk45Kb7
`2008-01-01 Opening Balance`
hledger-flow is my BFF for managing this: https://github.com/apauley/hledger-flow
Like others have mentioned plaintextaccounting.org is a great resource into the larger community.
[1] - https://hledger.org
https://ledger-cli.org/doc/ledger3.html#Principles-of-Accoun...
the data page might be as simple as
then a few report pages summing the valuesI will be honest, I use ledger and I like how it can express the complex transaction, however I also have to admit that I have never used them. If I were storing my finance data in a relational database or a spreadsheet, I would be very tempted to use the simplified two party model. I probably would not actually do it, but when I am elbow deep in code making sure to handle N-Party transactions correctly, I would be tempted.
The author of the plain text accounting system(PTA) went with this simplified model and made a good case for it, one line per transaction is much easier to parse, for both the human reading them and the machine. note that PTA does support split transactions but they are the special case.
https://mandoc.bsd.lv/pta/README
For the past decade or so I record the transactions on the mobile version, and use desktop software to dissect the data in more effective ways.
A few YouTube vids made the interface less daunting and I read a few Reddit comments on how people use it themselves, and I'm applying what I can to my own setup.
If there's anything a new GnuCash user should read or learn, please let me know!
The main problem is that I don't want to give a third party access to my bank accounts, so importing into gnucash is (1) download pdf statements from bank (2) use python scripts I wrote to convert to csv (3) use gnucash importer to import.
This is fairly painful stuff, more so because my bank statements are all generated on different days of the month. So I can't form a habit of doing this regularly enough to make the data useful.
I guess similar results might be possible with other accounting tool but Ledger perfectly meets my requirements. Also, it integrates pretty well with Emacs and I get to check my reports from there.
The only thing I'm really missing are custom fields, I slam a lot of information about transactions into comments.
Processing the CSVs takes about one second per year of my data, so what I think I'll probably do is summarize it out to ledger format each year.
I was using awk to do the CSV parsing, and it's blazing fast. But it gets a little bit unwieldy if you have to do multiple passes through a file or if a single CSV file has multiple sections. So I moved them to Python which is far more capable, but slower.
I’ll do my part and throw in what I believe is the most popular modern take on this, beancount. I ended up going back to ledger but if the super old school interface and stack bother you, beancount might be nicer. Plus the beancount docs are just out-of-this-world good for learning double-entry accounting in general.
Docs: https://beancount.github.io/docs/the_double_entry_counting_m...
Comparison: https://beancount.github.io/docs/a_comparison_of_beancount_a...
For many years I suffered through QuickBooks because I just assumed that was the Only Way. The single biggest pain point (and it's hard to pick just one) is that QuickBooks makes it absolutely mind-numbingly difficult to bulk-change any entries in your ledger -- if you categorize 1000 items one way and your accountant later tells you to recategorize them, there is NO WAY (or at least there was no way when I did this in the early 2000s) to bulk recategorize items. So I remember the pain of having to manually change thousands of entries or, worse, doing indecipherable things like making single journal entries like "moving from X category to Y category".
Discovering ledger was a breath of fresh air because the source data is just text! If you need to change data or recategorize or make any tweaks whatsoever you have the entire world of text manipulation tools at hand. You can write shell scripts and use IDEs (and believe it or not Github Copilot works REALLY well).
It's just amazing to realize that the perfect accounting solution has been there the whole time and is vastly vastly SIMPLER than I ever imagined. I went through all the SaaS tools (Xero, etc.) and nothing felt right. Ledger just works and feels right.
> and believe it or not Github Copilot works REALLY well).
And yes, this is one area where LLM can help. That valley between "manually duplicating these near identical entries is painful" and "but it's not painful enough to warrant a custom generator". LLM is often great for that kind of boilerplate. Gotta doublecheck the bejesus out of it though.
Some notes:
- The initial setup of the books is pretty time consuming especially if you have a lot of accounts. I recommend starting your most important accounts and adding as you go along.
- Mass changing categories is just a search and replace so I have been getting pretty fine grained with the categories as I go along.
- Being a small business the separation from business and personal is needed from a legal standpoint, but from a practical standpoint I live off an owner’s draw and a put cash into the LLC when investing in its growth. Having hledger have all my accounts, personal and business and being able to filter out appropriate reports has been great for seeing things like is the business a money pit or am I actually growing wealth over time.
- I combine hledger csv output with Jupyter to generate the specific reports and charts I need. I.e business specific versus combined for taxes. This filtering also has me thinking of other ideas like figuring out which credit cards to apply for based on my expenses.
Overall more fine tuned than what I have been able to achieve with Quickbooks over 8 years.
Or, at the end of the day is the default interchange format in this space just CSV?
Something tells me they can't be too picky about such things. My experience with the tax authorities in three countries now tells me they'll take whatever odd format data you hand them.
https://www.skatteetaten.no/en/business-and-organisation/sta...
> SAF-T Financial is a standard format used in the exchange of accounting data. SAF-T, or Standard Audit File-Tax, is the result of a joint development collaboration between the business community, the accounting sector and the Norwegian Tax Administration, based on a recommendation by the OECD.
So at some point you are going to have to deal with an accountant who will not typically know what ledger is. The solution is actually very simple: we wrote a small ruby script that generates an excel file that contains a balance and profit and loss statement in a format they are familiar with. That's the cool think about everything being text based, it's really easy to pipe the ledger output into a script and into a gem that generates an Excel file and add some styling.
The raw journal files are also in a format accountants can easily comprehend, they didn't actually look at those in our case, but if they want to know where the Excel comes from they are welcome to audit them.
Suffering through QuickBooks is literally a product feature. Like, when they were porting it to the online version, bookkeepers got upset that the web version didn’t have many of the frustrating quirks of the desktop version that they’d spent decades learning to deal with. They see their having learned the bizarre ins and outs of the software as a moat that keeps their clients from doing their books themselves, so many/most require their clients to use it. And Intuit is far more responsive to the interests of CPAs/bookkeepers than it is to the end users who pay for it.
Source: I worked in Intuit’s SBG and was really surprised when I heard that from some of the product people. I’m so used to being user-focused and searching out ways to be more user friendly that it never occurred to me that, in a 3-sided market, making the software hostile to the user could be a selling point.
The best my (awful) banks seem to be able to manage is old-fashioned CSV exports, so there’s little benefit from having something with the ability to call out to an API or import (US) standardised file formats.
Anyone else doing it this way? Seems to be going pretty well so far and of course doesn’t require learning a new query language. I’m sure there’s a lot more to (h)Ledger than that, though.
https://ledger-cli.org/features.html
https://github.com/ledger/ledger
Everytime I make a transaction, I put a note on my phone. The note is a simplified version of hledger file format. Example:
24feb 12.5 cash food eating out at xx 6.5 bank1 phonebill 25feb ...
and so on. As you can see, each block is started with the date, and each line corresponds to a journal entry. In each entry, the first item is the dollar amount, the 2nd item is the credited account, the 3rd item is the debited account, and the rest will be taken as the entry description.
Every week end, I will parse this note with a Python script that I wrote, and put the output in the actual journal file. The shorthand account names in the note will be converted into actual account name (e.g. 'bank1' to 'assets:bank:bank1'), based on a dictionary file.
I'd then proceed to manually check that all ending balances in hledger match with the actual amount in the real world. (It's pretty satisfying to see the numbers match.)
After I've finished processing the note from my phone, that note will be archvied and I will start with a new note.