Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Plain Text Accounting (plaintextaccounting.org)
473 points by sundarurfriend on Jan 12, 2021 | hide | past | favorite | 200 comments


I can really recommend doing this for your personal finances! Tools like ledger are really powerful, and properly accounting is a great way to save on money. I can very easily go into my personal ledger and (say) get a report on "How much money did i spend daily on groceries last month" or "List all subscription services i pay for and how much they cost each month" or whatever. It gives you a great view into where your money is going and helps you plan for the future. It's very satisfying to run the command "ledger reg -Mn Assets Liabilities", which is "show me my net wealth (i.e. the sum of Assets and Liabilities) for every month in the ledger", and see your personal wealth grow over time.

But almost more importantly: if you're a programmer, it's really very fun! Like, i have my own system where I download my bank statement as a CSV and process it in AWK together with an org-mode table of payees that map each line on the bank statement to an account, which then generates a ledger file. Since it's just you using it, you can make it so it works however you like, and it quite satisfying to see it all come together.

It's also a great way to learn about accounting. Turns out, I really kinda like accounting! It has many of the same pleasures of programming or math, and seeing everything balance is very satisfying. In short: if you're a programmer who feels like they haven't quite got a handle on their finances, I can't recommend plain text accounting highly enough.


Besides having a solid payoff for your personal finances, a 100-level knowledge of bookkeeping and accounting, I'd argue, confer near "super powers" when it comes to dealing with finance and accounting people. 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 took this course about three years ago (which, coincidentally, starts today!) and I completely agree - a basic knowledge of bookkeeping is an incredibly handy skill in all sorts of real-world situations:

https://www.coursera.org/learn/wharton-accounting


Most of the Coursera courses "starts today". Check tomorrow, you'll still see the same message.


How do they manage it possible ?


These must be pre-recorded, available on-demand.


Big plus one. Especially if your software work is even remotely finance-adjacent.

The moment I start talking in terms of liabilities, virtual accounts, etc. their eyes light up!

Incidentally, Accounting and Software have a lot in common. They both build and apply abstractions to the "real world" (flipping-bits), in order to give the abstraction-wielder more power and insight.


I second this. Accounting training enabled me to break my siloed attachment to IT and become a valuable asset to finance and accounting groups as well. Since they controlled all of the money they would come me to me discretely to get information and feasibility assessments on hardware purchases and development projects. At a small company this effectively made me the CIO's #1.


> How much money did i spend daily on groceries last month

Can you expand on this slightly? One of my frustrations with personal finance tools that I have tried in the past is that they're really bad at modelling occasional expenses— for example as a low-car family, we only fuel our vehicle once every 4-5 weeks, so some months the "gas budget" goes unused, whereas other months if we take a trip, we'll completely blow the gas budget because we fuel up twice or three times.

I wish it were possible to "smooth" those kinds of expenses into an average daily amount, but also have a way of indicating that a particular chunk of them should actually be extracted from the smoothing and assigned to a different category altogether (eg, the gas used on the trip should go to "vacations", not "vehicle"). A similar thing applies with other bursty things like home repair expenses, where I'd like my Home Depot receipts amortized over a time period that I specify rather than counted right at the moment of purchase.


With ledger, this is very easy.

I also run a janky Python script which imports my various .csv files, detects which is which, and turns them into ledger entries.

So a vacation stop at a gas station would look like this:

    2021-01-01 Chevron
    Assets:Checking   $-100.00
    Expenses:Auto:Gas
So lets say I know I spent $40 of that on food, and want to put another $40 into the vacation budget, I modify like so:

    2021-01-01 Chevron
    Assets:Checking   $-100.00
    Expenses:Food     $40
    Expenses:Vacation    $40
    Expenses:Auto:Gas
And it puts the rest in the gas budget.

There are ways to report average expenditures and smooth them out, ways to report how many days between each purchase in a particular category or from a particular merchant, and so on. Want to amortize a particular purchase? No problem, it's a periodic transaction.

ledger-cli can do accounting, really if there's a question about your money or a way you want to keep track of it, it's covered. Several graph libraries can ingest ledger files.


Well, whether you assign the expenditure to vacations or vehicle is a choice (and I could see arguments for both). So software isn't going to help you with that.

I use YNAB for budgeting and they basically advise what you're requesting - figure out what the "average" is over a given period of time and just budget that amount. Say you contribute $200/mo to an all-encompassing gifts budget, you may only pull from it a few times a year but the money is already earmarked.

Amortizing things doesn't make sense for a home budget - the whole point is to know whether or not you have enough money for x.


What I do is I create a budget for an entire year. That smooths out expenses that don’t happen on a monthly cycle.


I use a spreadsheet, two adjacent columns, one for incoming, one for spending. The column pair is titled as Gas, Registration, Repair. I look back at 1 year history, average those per paycheck, put money in each column from each paycheck. I minus them when I spend. Each row starts with the dare of transaction.


> modelling occasional expenses

I would say it's very hard to budget for bursty things on a monthly cadence. You can have a "virtual account" for this stuff, that fills on months with little activity and drains on months with more activity. But this is kind of complicated and might not be worth it.

I'd try answering the question: what is your goal in budgeting for gas, for example? Is it to keep gas spending under control? Or to understand how much you spend on gas? And if you want to understand, why? Budgeting is a solution to some answers to these questions, but not all of them.

Personally, I find it more useful to track these things, than to budget them, if that makes sense.

For example, I want to know how much I spent on rental cars in 2020, because that impacts our decision to lease a car in 2021.

> a way of indicating that a particular chunk of them should actually be extracted from the smoothing and assigned to a different category altogether

In GNU Ledger, you can apply arbitrary categories to each expense, and you can also "tag" line-items. For example, if you think 80% of your last refill was from a trip, you can do as follows:

  20201/01/12 * Chevron
    Expenses:Travel:Car:Gas             $16.00 ; :vacation:
    Expenses:Travel:Car:Gas              $4.00 ; :commuting:
    Liabilities:CreditCards:AppleCard  $-20.00
You can then do queries to see which of your gas came from commuting, and which came from vacation.

You can remove vacation from your reports altogether, and you can also focus exclusively on each vacation. You can even tag vacations, if you so choose.

  ; :vacation:lasvegas2021:
> amortized over a time period that I specify rather than counted right at the moment of purchase

You can achieve this behavior by specifying "effective dates" for certain purchases.

For example, when I buy plane tickets, I like to amortize the cost of that ticket over each day I'm at my destination (similar to your home depot example).

  2020/01/11 * American Airlines
    ; three-day trip to Colorado
    Expenses:Travel:Plane          $80.00  ; [=2020/02/01]
    Expenses:Travel:Plane          $80.00  ; [=2020/02/02]
    Expenses:Travel:Plane          $80.00  ; [=2020/02/03]
    Liabilities:CreditCards:Apple $240.00
The dates in the comment are called "Effective dates". You can ask for reports to be presented with either effective dates or transaction dates, at query-time. Note that the credit card payment's effective date is identical to the transaction date.

Let me know if you have any further questions! It's a fun topic.


Remove the `=` and you don't have to choose!


I had the same wish, you might be interested in https://github.com/simonmichael/hledger/blob/master/bin/hled...

However, reporting average expenses is easy, and sometimes enough..


I think myself and many others could have written the same comment.

I’ll add that it’s also delightfully easy to get started.

As an application, Accounting is kind of like Vim or Excel or other tools with steep learning curves and nirvana at the end of them.

You can start by just tracking one bank account by hand which is easy enough and fun, because you’re still learning how this accounting thing works.

Pretty soon you’ll be tracking your investments, ISOs, taxes, credit card points, and so on as absurdum. You’ll be the person who finds the bug in your employer’s W-2 generator...

It’s a steep time investment, but once you’ve written the automations, it’ll take you maybe 30 minutes each month. And you’ll never experience the feeling of “not being in control” of your finances again.


Do banks have anything you can use to automate getting data off their websites? My annoyances lie in generating the csv files. My checking account outputs an arbitrary range of dates, however many transactions fit on pg 1, while my credit card from the same bank outputs csvs by billing cycle. It makes it a little annoying going into the bank website and generating these files across relevant date ranges.


In my experience (USA), most banks will give you the option of downloading a CSV for the last two years of transactions. Beyond that, it’s a challenge.

Some investment brokers will only give you PDFs with tables in them. But there are some pretty amazing libraries for converting these into CSVs, that have worked well for me.

Some people use plaid, but I didn’t like the idea of introducing a middleman-dependency.

What I’ve been doing over time is downloading all of the raw transaction history I can get, and storing it in a git repo. Each month when I “top it off”, I just use git add -p to add only the latest bits. The most annoying part is when they change their CSV format on you (Chase did this recently) and you need to reformat all of your historical data to match.


Maybe your bank is better about this and offers OFX, but ultimately I gave up on this approach due to my bank adding more aggressive anti-scraping measures over time. The credit card sites were even worse about this.

Now I have a Postfix server setup which accepts the daily transaction summaries they send and makes CSVs out of those. There's still some HTML munging involved but I've found it much easier to let the data come to me than to go out and try to fetch it myself. In my experience financial institutions simply don't have a lot of reliable automation options accessible to the normal consumer.


> Do banks have anything you can use to automate getting data off their websites?

There's an Open Financial Exchange (OFX) standard that's supposed to be for this, I think. I came across it when someone mentioned the ledger-autosync [1] tool that tries to use it to get your data from your bank automatically. If I understand correctly (no guarantee on that), this automation would work for institutions listed here [2].

[1] https://github.com/egh/ledger-autosync [2] http://www.ofxhome.com/index.php/home/directory/successfulRe...


I just got started using the ofxget command in the ofxtools package. It was a simple "pip install --user ofxtools". After that, I read some of the docs for ofxget and configured these with the settings from ofxhome.com and I've got automated ability to pull in my transactions for credit cards, checking accounts, and even long-term investment accounts. It's really cool to interact at this low level because there's so much control compared to QuickBooks/Quicken.


I've found being "fun for programmers" to be undervalued. Using Ledger is fun, which has caused me to spend more time thinking and understanding my personal finances which have in turn improve my personal finances. I haven't cared as much using less hackable tools.


same! apparently i tricked myself into caring about my finances in this exact way


> properly accounting is a great way to save on money

The submitted page links back to a previous discussion on HN:

https://news.ycombinator.com/item?id=12119050

Funny enough the top comment on that discussion concludes:

> I now focus my efforts on income expansion rather than cost control. Some of you may say, recording costs is not controlling it. In that case, I find accounting, even less useful (once I have arrived at approximate cash outflow). Income expansion, puts me in a different frame, which I find strangely empowering. Even more so than the satisfaction that comes from having controlled costs.


I’ve been waiting for the perfect reason to start running my finances like I run the other things I enjoy, and this might be it. If I can make it fun, I think I could stick to it. I’ve tried some of the apps and... I just don’t get enough out of them to warrant throwing that much of my sensitive data at them for free... in fact summarizing it here makes it sound insane. Thank you kind hacker news commenter for sharing your wisdom :)


This is another excellent reason for using ledger: you are in total control of your financial data. It’s just text-files, you don’t have to share them with any service, they are not in some weird binary format, and you can use standard tools like git to work with them if you want. You can also collect all the information from every financial service you interact with (banks, credit unions, credit card companies, brokerages, whatever) in one place and get reports on all of them at the same time. It’s the bee’s knees!


I agree with the fun part. I found this to be a nice intro to the concepts of double entry accounting: https://martin.kleppmann.com/2011/03/07/accounting-for-compu...

Previous HN submission : https://news.ycombinator.com/item?id=2298471


I used to used GNUCash heavily with double-entry bookkeeping; nowadays I use org-tables' spreadsheets functionality. I've also done a bit of tax calculation using CL, and always meant to look into ledger, and it sounds like it might fit the flexibility requirements I have come to (ab)use in org-mode.


I generally only care how much my net worth has increased. I've found that I taking the time to enter every single receipt and expense outside of my personal business accounting is largely a waste of time.

For me, the most meaningful info is a markdown doc where I quarterly asses all of my investment accounts / assets and come to a "current net worth total".

I've found a personal correlation between trying to minimize and track minuscule expenses and a decline in my mental health or happiness at work. I'm frugal by nature and trust myself enough to not worry too much about day to day spending.


Im in a similar low-stress situation and I am grateful for it. I have an e-fund that can handle anything, and was from a lower income family for long enough that my natural inclination towards any impulse purchase or lifestyle creep is 'probably not'.

Aside from some fairly basic goal tracking, boring boglehead investing, and making sure nothing stupid is being transacted, I really don't do a lot and everything seems to be working. Dont @ me about my warhammer addiction though...


Same. I keep a spreadsheet that I update once a month with assets, liabilities and net worth. Takes me about 5mins and is a good check to detect unexpected spending or trends.


A simple solution to this is to apply these principles only to accounts of a meaningful size and to exclude "petty cash". Tracking capital assets with double entry accounting systems has a ton of benefits for someone in your position:

* Tracking the cost basis of your capital assets

* Tracking fees related to transactions involving capital assets

* Calculating taxes

* Analyzing allocation of capital assets into categories

* Tracking drift from a target


I literally don't care. I'm going to Acknowledge My Privilege TM (Hacker News Edition) and again state that these types of expenses aren't worth my time to worry about. I pay an accountant to worry about book-keeping and taxes, well worth the $400 a year to cover both my business and personal taxes.

I'm not going to adjust tens of thousands of dollars of capital assets because the management fee moved 0.05%... Who do you think I am, Elon Musk? I'm glad you enjoy using your time to do track these kind of things, but I gladly choose not to learn my accountant's job.


It sounds like you're paying the accountant only to do your taxes? If so, your finances are probably not complicated, and you could probably do your own taxes in 1-4 hours. Of course, how much that is worth to you is up to you.

If you're paying an accountant only for taxes, and not general finances, chances are your financial life and investments are very simple. Either that or you're not managing them well :-)

Some people have multiple investments - some liquid (stocks), some illiquid (properties). They have side businesses (e.g. rental income). They have to allocate money for repairs on their rental properties. They have to set money aside for vacancies and property taxes, etc. You're likely not going to find an accountant who'll do this for a mere $400/yr.

If you have rental income and are not managing this, sooner or later you'll lose a lot of money. I guarantee it. Also, most people who have properties do not make that much net profit (typical is $100-200/month per unit), so paying, say, $2000 to an accountant could wipe away the net profit from one unit for a whole year.

No one is trying to tell you that you should use these tools. Many high income folks do fine without them. But if you have side businesses, you either need to spend a lot more on an accountant or get more disciplined. Most people will choose the former if they can afford it (which is probably a good idea).


Okay, I can clarify here. I meant to say, my accountant fees range from about $1200 - 2800 a year. $400 was an off the cuff estimate and admittedly way off. You got me ;) I would still happily pay $3500 to not spend hours a year entering innocuous expenses into a fucking text editor.


> I would still happily pay $3500 to not spend hours a year entering innocuous expenses into a fucking text editor.

Fair enough. If your expenses are at the level of mine, I'd gladly take your $3500/year to do it for you. :-)

And given that several commenters have said they spend about an hour a month on it, after all automation is in place, I'm sure many would take that money from you. It comes to about $300/hour. Certainly some people are earning a lot more than I am, and paying $300/hour is worth it to them.

I'm not a hard core ledger user, but I have a simple solution: I don't enter anything into a text editor. I enter it into a fairly nice money management SW (using a GUI), that autofills a lot of stuff for me, and lets me import from my bank/CC. And then I simply run a script to convert its data format to ledger. I'm sure I spend more than an hour a month, though. I haven't automated most of my data sources.


How on earth do you find an accountant to manage both your books and your taxes for only $400 / year? Even LTPs are more expensive than that.


This is like commenting on a recipe article with "why bother cooking when I can get my chef to do this?".


I mean, your brokerage will do most of those things automatically for you.


My brokerage always gets the cost basis wrong for SPP. Always. The company sends out annual notices to the employees informing them that the brokerage's statement is wrong.


I just put all my expenses (except rent) on a single credit card. Chase generates a spending report that categorizes transactions for you, so you can see how much you spent on food/groceries/travel etc. each year with zero legwork put in.


Same here. I got started with ledger but found it too tedious to log every expense and didn’t really see any benefit. I already know I spend too much on eating out but it doesn’t affect my net worth in any significant way so I continue doing it. Schwab is able to tie in your other accounts and give you a big picture of your net worth.


I take the same viewpoint. But that is, admittedly, a position of privilege. Tracking "net worth" is out of reach for the vast majority of people who live paycheck-to-paycheck.


I do similar, except on a monthly basis. I use a google sheet, and record the balance of all bank and investment accounts at end of month. I also track my crypto holdings there as well.


What crypto holdings fellow non-us citizen ;) ?


I am an honest tax payer. I report all my crypto transactions. It's not worth being audited.


I don't know, I've been intrigued by plain text double-entry bookkeeping for a while, it looks like fun, but on the second thought I just don't see any real benefit for a regular person (probably, most IT specialists don't qualify). You get your salary, you set aside 20-75% to pay the bills, some amount you know from experience you need for groceries and other recurring expenses (like public transport and household goods) and if you happen to have anything left it goes to savings. If you're privileged, you'll also have some petty cash left for occasional lunch/night out. When you need to spend some significant unplanned sum you take it out of savings, if you have any. If not, you eat less or go into debt.

What's there to track, how much you've spent on potatoes and underwear this month versus the previous?

That was the scenario for a disciplined citizen. Most just pay the bills (not necessary all of them) and then just spend what's left on their debit card until there's nothing left. It usually happens before the next salary, of course. No accounting software would help there.

UPD: I'm not sure it was the right place to spill my negativity, I fully understand the benefits of being organized with your finances.


Like everything you will eventually end up with diminishing returns. E.g. I doubt many people track potatoes vs carrots, or underwear vs socks.*

But:

1) Once you've automated most the of the steps, it takes, say, 1h per month to have everything up to date, so basically nothing.

2) Compared to no tracking, you can often end up finding money another party owes you. At that point, the 1h per month is financially worth it.

3) How little can you spend if times are tough? Any theoretical budget will pale in comparison with actual tracking of past expenses. Once you know this, you know how many months of spending you have in cash, meaning you can invest the rest in the long-term.

4) How much will you spend in 5 / 10 / 20 years? Why? You can better estimate this with accounting.

5) Let's say you spend $x on hobby A and $y on activity B. Does that reflect how much you like A and B? If not, maybe change it?

*: still... how diminished is your salary if you start a job that requires that you wear a suit everyday? Is it still better than the other offer you rejected? Maybe you made a mistake? This is way


...way easier to assess once you have such tracking in place.


The benefit is mostly for scenarios with a couple more degrees of freedom than what you describe. If you share your finances with N people (family) or N companies (free-lancer/consultant, etc), the path of least resistance to financial sanity is a well-maintained ledger. If you see this stuff coming in your future, your future self will thank your present self for getting started when things were easier to track.

It's also a single source of truth for your entire financial existence. You can use it to track your asset allocation. Which some people in the bracket you describe care a lot about.

Of course, you can pay people to do all of this stuff for you. (Accountant, Investment Broker, etc). But there are well-documented costs to these solutions. Basically, you have to trust them a lot, and if you don't speak their language you can't verify their choices.

Edit: to be clear, I'm not saying that maintaining a ledger is the right choice for everyone. It's a trade-off, like anything else, I just wanted to explicitly observe the variables that were at play in my decision. YMMV


> If you share your finances with N people (family) or N companies (free-lancer/consultant, etc), the path of least resistance to financial sanity is a well-maintained ledger.

that was it for me! i started using hledger because of:

- tracking irregular payments from a bunch of sources, often outstanding for a while

- tracking how much somebody owes me / i owe them

- being pretty much cash-only for a long while (long story). with cash, if you don't track the expenses manually, you wake up at the end of the month with a whole bunch of money gone and no idea what happened to it

- not knowing how much money i actually have available because it's spread across my wallet / bank account / paypal / piggy bank

hledger really helped me not go crazy with all of this!

PS. another unexpected benefit - tracking expenses can also help with ambient worries like "ugh i spend too much on takeout food". like, if you track it, at the end of the month you can look at how much you spent on it and conclude that it's actually reasonable (within your budget) and stop feeling guilty about it!


Everything you described is a great gateway drug for GNUPlot :)

Inspired by your example, here's our rolling monthly sums of food expenses, COVID marked [1].

You can see where we moved (temporarily) to a place with lower food costs, and stopped eating out.

But there's also a dip around the holidays, because we spend a lot of that time with family and our food expenses go down proportionally. That dip happens to be consistent YoY, but we don't realize it because we have other things on our mind.

It's just great fun to have this stuff at your fingerprints.

[1]: https://imgur.com/a/8wb6YLn


i haven't used gnuplot before, what's your setup for getting these? a monthly-cumulative plot is exactly what i'm missing from hledger-web.


I’d never used it before using it for ledger, either!

It’s kind of tricky. I have an AWK script that reads a ledger report to compute the X and Y-value pairs. These are written to a temp file that is read by GNUPlot.

It’s a bit of work to get setup, but I’m able to copy paste the idea around my reports.

I’ve also found the GNUPlot manual to be very easy to read!

I’m away from my laptop now, but I’ll add a gist tomorrow.


Here's the pastebin for those interested. (it's three files).

It probably would have been better done in python (I probably wouldn't have needed the zero-inserting hack), but it works pretty well.

https://pastebin.com/mxXDqqTK


You can use command-line hledger to produce the appropriate balance report data as CSV, suitable for gnuplot (or drag into a spreadsheet and use the charting tools there).


I've been using GNUCash since 2007, while in grad school earning... grad school wages. It worked out well for me earning IT specialist wages now, and I don't think the regular joe will need/use plaintext accounting specifically. But the idea of double-entry bookkeeping can be useful still.

1. Accurate visualization. As you suggest, a great number of people pay most attention to their checking account balance. Making student loan payments on time can feel like just paying 'bills'. But it's actually a split between interest and principal, and in a sense, you are accumulating wealth by paying down principal in a way that just looking at the debit card balance will not. Similarly, racking up CC debt can feel cheap when making minimum payments.

2. Improved forecasting. Before GNUCash I largely worked the same way as you describe. Keeping a mental tally of bills outstanding and checking my balance via the automated phone system to judge what I can spend. Now I have scheduled transactions for those bills recorded 90d in advance, and can see at a glance my Minimum Future Balance. It's nearly the same thing, but with way less acid reflux from stress. And I can schedule in all the random annual expenses -- vehicle registration, vacations (when permitted), annual subscriptions -- just once and the system remembers for me. Plus I have a more granular archive of expenses to estimate and budget around.

3. Expense Analysis. Most people track one asset: checking acct, and maybe liabilities. Double entry accounting makes it feasible to transition from that to treating expenses and income as equally important. Probably the canonical example is car insurance; most insurers offer a six month premium, or a monthly payment with a surcharge. If you focus on checking acct balance, you go for the monthly payment with smaller upfront. If you want to reduce your annual expense you pick the six month option, dipping into savings briefly if required. On the income side, you'd be surprised how many people don't even bother to get the employer 401k match, even though you can often carry a CC balance (a very worst case scenario) and come out ahead.

4. (advanced) Portfolio balancing. If you're fortunate enough to fund a retirement plan, tracking your portfolio and asset allocation can be tricky across Roth IRA, 401k, etc. An annual rebalancing, formalizing the 'sell high, buy low' formula, is equally tricky when none of your accounts synchronize. A double entry system makes this and other retirement planning steps feasible.


There are two possibilities:

1. There are people who like to create complex analysis/structure around their lives. I don't say they are unnecessarily complicating their lives, because that's part of their personality. So, yes, you are correct. An double-entry ledger doesn't add much insights.

2. After $200k/year income and $1m+ wealth, and if your wealth is very diversified (inherently complex), then I can see the value in it. ie: An engineer with $200k has less complexity than a freelance with $200k/year. At a certain point the freelance will benefit from an accountant, but maybe he's running some stuff in the dark economy or something.


> When you need to spend some significant unplanned sum you take it out of savings, if you have any. If not, you eat less or go into debt.

Doing detailed accounting helps prevent you from that "go into debt" scenario.

Typical long term things people forget to save for:

- Their next car

- Car Repairs

- House repairs

- New roof for house

Etc.

With detailed accounting, you can set money aside for these things, and then when you suddenly decide to go on a vacation, you know how much money you need to leave aside in your savings to cover the above.


I used ledger for a year. I was able to script conversion of my transactions to ledger format. It was good to see where my money goes. But like you said, I don't care much about budgeting or tracking my personal expenses. As SWE (not to brag) I make enough money to not think about these things. I'm also pretty frugal person, so majority of my expenses are just food.

Now, I also have a small LLC. And I used to track my business income/expenses. It's useful, but also, I don't have that much volume to really care about ledger it's just too much work right now. Last year I did taxes with ledger, it was PITA to import everything. This year I just dumped my transactions into google sheets and setup pivot table, which accomplished exactly what I needed for tax return.


I agree with your premise, but please "pay yourself first." [0] Instead of putting "whatever's left" in savings, decide how much you need to save to meet your goals, put that amount aside first, then use the remainder to pay bills. An envelope system [1] works well.

If you don't have enough, reduce your expenses, not your savings.

[0] https://www.investopedia.com/terms/p/payyourselffirst.asp

[1] https://www.daveramsey.com/blog/envelope-system-explained


I very strongly disagree with that method. There is a lot of natural variance in how much people spend in a month. Some months you spend $1k, some months you spend $10k. It doesn't make sense to use a fixed monthly budget at all. It also just encourages arbitrary gerrymandering of your expenses. If you want a PS5 but have no more room in your budget this month, you might decide to buy it next month instead. But then you'll just end up spending the exact same amount next month, so you've deprived yourself for one month for zero financial gain just because you're gaming the arbitrary constraints you impose on yourself.


The problem you're really trying to avoid is not knowing that you're subtracting from your savings target. It's too easy for expenditures, especially small ones adding up over time, to grow unbounded without you noticing, and if you're putting "the rest" into savings, you end up noticing the problem after the fact -- you can only affect the next month.

If you instead allocate first, and operate the month assuming you never add had access to the funds, then it becomes painfully obvious that you've spent beyond the target -- and can make the decision then whether that's fine, and pull out the money from the savings buffer as needed (and presumably up the savings envelope for next month).

The main thing, I think, is that most people (not living hand-to-mouth) spend to their financial comfort -- not their physical comfort -- growing concerned mainly as they approach their upper limits, and then reduce accordingly. I'm thinking of Braess's paradox; you spend to the money you have, even if you'd be happy & fine with less.

So by reducing the total funds up front, you reduce spending earlier accordingly. Of course, no more so than what would make your lifestyle uncomfortable.


The psychological bias works both ways though, if you operate on a fixed monthly budget you might be tempted to spend more on stuff you wouldn't otherwise spend on if you notice you're under budget for the month.

Also a mental bias against spending is not necessarily a good thing. Spending is like eating, unless you have a problem where you're doing it too much of it, doing less of it is not inherently desirable. I spent way less last year than 2019 because of Covid and my life certainly wasn't any better for it.


> The psychological bias works both ways though, if you operate on a fixed monthly budget you might be tempted to spend more on stuff you wouldn't otherwise spend on if you notice you're under budget for the month.

Which is significantly better than the other way around, because you’ve met your saving target(s). Really, that money constitutes legitimate excess cash. You can shove it into risky investments, or spend it freely; it doesn’t matter — you’ve met your needs.

> Also a mental bias against spending is not necessarily a good thing. Spending is like eating, unless you have a problem where you're doing it too much of it, doing less of it is not inherently desirable

If you’re spending over your saving targets, you are spending too much. If you’re spending under your targets, you’re free to spend more, guilt-free (you’ve covered your necessities, you’re playing with excess).

The only problem is if you set your savings budget so high that you can’t spend to your actual comfort (given your lifestyle). Then it becomes a question of accepting you simply don’t have so much money, and either reduce your lifestyle or extend your saving targets accordingly.

TLDR; meet your targets. Beyond that, do as you wish.


Depends. If you work as a software developer, odds are you make more than you need to live comfortably. In that scenario, it makes a lot of sense to be disciplined and put some amount of money aside first. I picked an amount to put into savings that still leaves me enough to not have to stress about groceries or going out once or twice. I basically always manage to hit my monthly budget, and save what I planned. If I wasn't putting money in savings first, I think I might end up spending a lot more than I should on tech gadgets and other things that I don't really need.

My approach:

1. Put a reasonable amount in savings first, but make sure to leave yourself enough to enjoy life, because you can't be completely sure you'll be alive in 1, 5, 10 or 20 years.

2. Spent on monthly expenses without stressing about savings, because some fun money is also part of your budget.

3. If there's any money left over when you get your next paycheck, send that into savings as well.


You’re suggesting saving a fixed amount, which is bad for the reasons I outlined in the comment you responded to.


It's only bad if you poorly estimate your minimal expenses over a long term.

If buying a PS5 is really important to you, then by setting money aside for it you are paying yourself first. For most working people, though, there are much more important things to save for, and the wiser decision would be not to buy the PS5 if it means reducing the savings.


Your scenario is not at odds with the parent's one. He's saying "Figure out how much I want to save for long term goals, and set that aside first" It doesn't preclude saving for long term expenses.


Once I had a well-paying job, inverting this was the best thing I did for myself financially: setting up a 50% direct deposit to a high yield savings account (and eventually investing) and only considering the remainder spendable for my day-to-day expenses.


I've heard of some individuals giving a plain-text ledger to their tax preparer. (Keeping a ledger does not necessarily mean tracking every personal expense.)


I'm currently in a part of the world where the government nurtures fiscal immaturity and just takes its share directly from employers salary fund. Some specific taxes come as bills too. Not much to prepare, unless you're an self-employed/entrepreneur, so it definitely skews my perception in this regard.


Double-entry bookkeeping is mostly for keeping business accounts. If you want some maybe try running a small business on the side?


Want to throw out one of my favorite stats: while conceptually the same, European double entry accounting predates Newton's 3rd law of motion by over 200 years.


I remember reading about the monk who invented it and it still blew my mind were using that system to this day.


I've been using beancount [1] and fava [2] to organise my personal finances for a while now, my beancount file has about 3 years of transactions/financial data in it.

I've automated a few things but it's still largely a manual process to update the file, which I do maybe 2-3 times a month. Requires some patience but I think it's worth it. Also the emacs mode for beancount is superb.

The main advantage is it's very flexible, you can track investments, bank accounts, credit cards, pensions and even abstract things like digital currency wallets (e.g. Playstation Network) or vacation time. I've even used it to track RSUs from employment etc.

[1] https://beancount.github.io/

[2] https://beancount.github.io/fava/


I love fava/beancount, but I wish the language had some method of abstraction. I keep repeating myself, but don't see easy facilities for DRY, etc.

e.g. When I do a debit card purchase I move currency from Whatnot:Cheque:Pending to the expense account, then later from Pending to Whatnot:Cheque:Current so for EVERY debit card transaction I'm copy-pasting a template and editing by hand.

Fava/beancount is so good though, that it's a local maximum - I'm a bit stuck.


The place to do this would be in ingest, wouldn’t it? The ingest configuration is just Python, so one could conceivably write a module to assign accounts based on the incoming data. I know there was a module that would try to use ML to do that based on your account history.

If you don’t want to do that, another option is hledger. I used that for a while before deciding to switch back to beancount for its ingest process. However, considering I have made no progress on that over the last year, I might just go back to using hledger.

hledger’s ingest process is not as sophisticated as beancount’s. You can’t write arbitrary plugins like with beancount, but you can pattern match on the incoming text and assign accounts that way. You can also define automatic transactions in your books, which I found incredibly helpful for managing my budget.


You can easily create any kind of abstraction with beancount's programming interface [1]. I find it very comfortable, because I can manipulate the data structure directly (and not just the plain text as in e.g. vim).

For example, here is a plugin that I wrote to "delay" a posting of a transaction to another date via an intermediate ("transfer") account [2] and its tests [3] that solves a problem pretty similar to yours (I should someday package my plugins properly and maybe put them on PyPI, but I haven't had the time yet). The beancount documentations also has a list of existing published plugins [4].

[1]: https://beancount.github.io/docs/beancount_scripting_plugins...

[2]: https://linx.marussy.com/selif/v31rtbi5.py

[3]: https://linx.marussy.com/selif/tpwlujdk.py

[4]: https://beancount.github.io/docs/external_contributions.html


Sounds like you need to develop a plugin or take a look at existing ones (for example effective date [1] might be helpful)

[1] https://github.com/redstreet/beancount_reds_plugins/tree/mas...


I wrote a couple of small bash scripts for common entries to keep the typing to a minimum.

./purchase 10 AAPL 128.80


I'd been looking into beancount and fava earlier, but somehow it took your comment for me to realise why the latter tool is called fava (=beans, referencing beancount). I'd previously ignored it as just another pronounceable-nonsense-name on the web.


I've been using ledger [0] in the past 2 years very successfully in keeping track of my personal finances.

I've tried with many accounting apps, but the clarity of the plain text, editing it with my preferred editor, and the capabilities of ledger (reading only!) are what kept me (I think). I also wrote an intro for ledger here [1].

[0] https://www.ledger-cli.org/

[1] https://sirodoht.com/blog/introduction-to-plain-text-account...


Your section on single vs double-entry accounting, specifically:

> We can neither create money out of thin air, nor make it disappear. Money has to come from somewhere and go somewhere.

reminded me of the excellent "Accounting for Computer Scientists" by Martin Kleppmann [1], with a very useful and easy to remember mental model of this process.

[1] https://martin.kleppmann.com/2011/03/07/accounting-for-compu...


Thanks for sharing the article. It's nice to get an intro from someone else also new to Ledger, which guarantees it starts from the very basics and makes for a good first step.

The other "getting started" guide I found [1], for a contrast, starts with a whole ecosystem of scripts and a system in place for effective ledger use - which will be useful later, when I do want to get a full system going, but I've learnt it's better to start simple and stumble around, until I can put together the pieces of the system myself later (with theirs as a very useful reference).

[1] https://rolfschr.github.io/gswl-book/latest.html#the-setup


Thank you for the guide. Found it very helpful.


I have been doing this for years, but for me the biggest downside is the lack of API at my financial institutions to pull data , which leads to a big time suck weekly/monthly logging into sites , navigating their poor UI to download CSVs.

Otherwise there is a great ecosystem of tools (and I have automated a lot of my own with Python) for parsing, classification, and import of data into the plain text ledgers.


I found that ledger worked best if you made it a daily habit to go in and record transactions. Also, since I recorded mine in org-mode files I could use something like Beorg to edit it while away from the computer.


I've ended up automating most of the data pulling with Puppeteer and a pile of poorly-written JavaScript; every once in a while one of the scripts breaks, but it's pretty rare and easy enough to repair.


Yes this is exactly my experience which is why I still use Quicken. My other concern is if something happened to me it would be much harder for my spouse to figure out than Quicken. However I have used beancount, fava and python to do my own financial planning i.e. what will my income, expenses, and taxes be in future, and being able to have different inflation assumptions for say medical care vs say food or transportation, as well as to have different return assumptions for index funds, vs bonds or savings. They are really great tools.


I’ve ended up using Plaid to solve this. I’ve got some scripts that talk to Plaid to pull transaction data and emit it in ledger format.


ledger-autosync [1] tries to solve this problem, by pulling the data for you from supporting banks. If I understand things correctly, this [2] is the list of banks it can successfully pull data from.

[1] https://github.com/egh/ledger-autosync [2] http://www.ofxhome.com/index.php/home/directory/successfulRe...


Looks US-only?


In a previous startup we used Ledger in git as our accounting system. Was pretty cool to submit expense reports as PRs.

Also, we had some CI automations to report company runway to Slack etc


All PTA tools have in common that they model accounting as a programming language, as opposed to data. This provides for a high degree of epressiveness and flexibility which is hard to achieve with database accounting tools that are typically data-oriented.

The basic instructions are open account, close account, and update account (transaction). In addition, a lot of PTA tools support some form of higher-order directives: directives that generate other directives.

For example, the availability of prices might trigger the insertion of valuation transactions based on the change of value for a balance position, when processing the balance.

Or declarative accrual transactions for a given date might insert "virtual" transactions at specific other dates.

The PTA / language-centric view allows to reason about those very easily, as abstractions which result in AST rewrites.


One day I realized I had less than $100 left in my bank account. I'm a software engineer. I know how to write software. So I did the responsible thing - I did not write software.

I literally opened Notepad.exe, and started making double-entry accounts of all of my expenses.

I broke them down into recurring expenses, surprise expenses, and then discretionary spending.

For each recurring expense, I made its own ledger of dates and the expense. I could then predict my future expenses. Given the current date, and knowing when the money would next be due, I could calculate how much I needed to set aside PER DAY, in order to be ready to meet that expense. Once that critical next date passed, I could achieve a steady state, of how much I needed to set aside PER DAY, for that expense.

I then started doing double-entry accounting on my main, available cash account, on a daily basis, subtracting the recurring expense daily amount each day. So, I had an actual balance, but then I also knew how much was left for my surprise expenses and discretionary spending.

I then went after my surprise expenses, and tried to come up with a rough flow rate for them, as well.

And then I gave myself an allowance for discretionary spending.

Mathematically, everything I just described was incredibly simple to do. No software required.

Having that discipline saved me from going in to debt.

I maintained that discipline until my cash crunch wasn't so tight.

And now I kind of wish I had the time to write the software. :-/

I also wish I could get my stupid bank to give me "Read-Only Credentials," so I could write software to poll my bank, and not feel so recklessly irresponsible about it. (Having ONE account, with the ability to disperse funds, it feels wildly irresponsible to leave software running with those credentials.) I know there's also the problem where someone receives 17 cents, and then reports "I got 17 cents" in order to establish the ability to make withdrawals from accounts. So then my idea of having the software running with read access could be used as an exploit to steal my money. sigh That's a big pile of BS.

Anyone have any recommendations for banks that would HELP ME securely do any of this, or do it for me?

I'd really love it if my phone went DING every time I spent money, and it asked me to classify the expense, right then, right there. Way easier than doing it after-the-fact.


It's probably not quite what you're looking for, but Apple Card tells me whenever a purchase is made against it.


Plain text is the universal computer interface. We will always be "returning" to it. We never should have left it, really.


I strongly disagree.

Plain text is great for data that is just that - plain text.

As soon as data isn't text, the idea falls apart quickly. What would be the advantage of storing audio data as text? It would take up more space, be ambiguous, and would require more memory and compute time to load and save.

Same applies to many other forms of data that aren't inherently text or supposed to be manipulated manually.

Everything is not text and everything is not intended to be manipulated and interpreted by humans directly. This applies to audio and video data, but also to a lot of specialised data formats that are optimised for the algorithms that use them.

So no, we won't always be returning to text and "leaving" text formats is a natural and important step for data that's not generated manually for and by humans (i.e. by means of manual data entry).


I used to worship at the altar of plain text, and indeed text is ideal in some situations. However I have found that text falls apart when I need to programmatically manipulate data and write it to a file. It’s hard to formulate structured “plain text” formats that are human readable, human writeable, machine readable, and machine writable. Yes it’s easy enough with simple data (and Ledger is relatively simple.) with richer and more complex data this gets very hard.

After years of using Ledger and trying to adapt it and my own systems to store richer financial data and manipulate it programmatically, I have migrated to my own solution based in SQLite rather than plain text. I realized that what I have is a data storage and manipulation problem, which is exactly the problem SQL databases solve very well.

Text works well for some things but it doesn’t deserve all the worship it gets in geek circles. Part of this was my own fault because I tried to make text work in situations where it wasn’t suited, but hopefully others will read my comment and not make the same mistake solely because they read some blog posts and other things from old-school UNIX heads saying “text is great!” Don’t try to make text do everything.


As a concrete example of what you're talking about, all of these plain-text accounting solutions are difficult/impossible to sort the transactions in because their plain-text-ness gives so much freedom.

Then, because transactions aren't sorted, it becomes easier to load up some kind of UI (CLI or GUI) to browse things by-date or by-account or whatever. To say nothing of charting & reporting...

And at that point...the usefulness of plain-text-ness seems quite diminished. It becomes more like a data-entry format than anything else.

That said, I continue to use a plain-text accounting system because the alternatives aren't really any better at this point and often come with their own issues.


Structured plain text sounds kind of self-contradictory. Obviously I don't know what you worked on but could the issues you ran into maybe have been easier to work with if the data were stored in multiple files and folders instead of trying to add structure to plain text?


Sure that’s possible but not any easier. Anything can be stored in “plain text” just as it’s possible to drive nails with a screwdriver. That doesn’t make it the right tool.


I'd be interested to understand the rough details of your system. I have played around with ledger and beancount, but like you I find myself wanting a more programmatic access to the data. Maybe what we need is a sqliteaccounting.org site to explain the pros/cons!


There are two main tables: one that can hold any transaction, and another that's specifically for transactions I download from bank and credit card statements. It holds different data such as the unique identifier that banks assign in the OFX data (this helps avoid duplicate transactions.) Difficulty in dealing with data like that is a big reason I started to move away from plain text.

There are other tables to hold what I call "categories" (accountants would call these "accounts") and "accounts" (these correspond to the more colloquial usage) and commodities and other items like the balances from bank statements.

I considered both SQLite and Postgres. Postgres has nice things like true ALTER TABLE support but SQLite's ease of administration and simple API swamps any advantage that Postgres would offer for this.

My user interface is in Haskell, but one could use any language for that - I just like Haskell. It's all CLI based. I import the overwhelming volume of transactions from bank downloads, but when I need to enter something manually I currently just write a little Haskell script to do it (eventually I might add a CLI program to do this.)


> It’s hard to formulate structured “plain text” formats that are human readable, human writeable, machine readable, and machine writable.

XML? Or is that too far from plain text?


It’s hard to do this in XML because parsers nearly always strip out comments and often whitespace too. Thus writing days to the file strips out important data that I expect to be able to add if the file were truly human writable.


XML is not human readable or writeable.


You are not wrong, but the argument is a text file could hold the link to the audio file and any metadata. I am a right tool for the job person so I use plain text for personal stuff but when it comes to work, there are so many more requirements at play that plain text is rarely the best answer other for, say, exchanging regular tabular data with third parties.


Without the right framework to manage sidecar files, this system rots quickly. Tools like DVC are good but there are still rough edges.

The issue partly stems from the lack of coupling between data and metadata on file systems. I think the next evolution of file systems involves the ability to link files together in an organic way. But that is tricky since it breaks the abstraction of files as stream of bytes. Might need to go up a level of abstraction and create new primitives for cp, mv, etc.


Agreed. Applications spend so much time trying to replicate user interface features that are inherent in plain text via any text editor. For example, full text search is already built in via Ctrl-F or part of the OS via grep or desktop search. Same with customizing the font, infinite scroll, adding/copying/deleting items, find-and-replace, convert to pdf (just print it), etc.


As an org-mode user for nearing a decade, including on multiple phones, I agree.


Oh really? In which encoding? ASCII? EBCDIC? UTF1/6/8/16/32, TRON, and gazillionz of other historical artifacts?


Because a proprietary or binary format would be easier to recover over time?

It’s usually pretty easy to figure out the right encoding for text files, especially when you know their origin (which I expect you would for accounting documents).

Additionally, UTF-8 is quite universally accepted these days.


UTF-8


Why the aggression?


Because dogmatic regression.


Yes.


Emacs is already mentioned, but not Emacs Org-mode, so here comes the obligatory Emacs Org-mode comment:

I've been doing my personal accounting in Emacs org-mode tables / spreadsheets for 3 years now. I do not need super fancy things in my accounting, but so far it worked great and I am quite sure one can build more complex accountings than mine, as one has the full power of elisp and calc at ones fingertips, when using Emacs org-mode.


Why not both! Of course, since it is org-mode, you can just do your ledger-ing in there (like any other source block), make reports, comments, etc. Literal programming becomes literal finances.

I haven't done this yet, but have played with ledger and org-mode separately. I've seen several articles about this, including on the official docs [1, 2]

[1] https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-...

[2] https://orgmode.org/worg/org-tutorials/weaving-a-budget.html


Seconded, although I feel I'm pushing the limits of org-tables. That being said, being able to pull values between tables with "remote(table-name,@Row$Col)" has been a game changer.

I may have to look into ledger, but it wouldn't even be on my radar if it wasn't backed by plain text.


Big fan of org-mode, although I recently stopped using it in favor of Joplin. I may switch back sometime if I can find a way to mimic Joplin's UI in org-mode (probably with an emacs tree plugin).

I love comments like these. The moment I see the words "plain text" in any HN post I always go to the comments and ctrl+f emacs.


There seems to be a general return to plaintext tools like HN: danluu.com, plumebio.com and lite.cnn.com


I think it has always been popular in the bubble that frequents HN, I wouldn't go that far to say there's a general return to plain text.

The rest of the world would still think it looks like the website is broken if it looks like lite.cnn.com


> The rest of the world would still think it looks like the website is broken if it looks like lite.cnn.com

For me it's the opposite. In "regular" cnn.com I obtain an empty page (probably due to my overzealous adblocker), yet in lite.cnn.com I can read the news.


Yes, but you are "in the bubble that frequents HN" ;)


I had no idea that CNN had a "lite" version. Do you know any other major sites that have lite versions?



Same here. This makes me very happy.


What are the alternatives?

Two of the commercial products listed (Quicken, Quickbooks) are from Intuit. One of the worst software companies out there. Aside from their "Free" Turbo Tax fiasco (easy to find via web search), Quicken was the most infuriating program I ever used.

I now use MoneyDance (no affiliation, customer for 5+ years).

It's a Java program. It just works. It looks the same after every update. Updates are free for a couple of years. Then I pay for the update, because I like them and want them to succeed.

They have a user forum where problems are solved.

I no longer swear about my finances, unless it's about my finances. The software I use is now invisible.


For those who prefer a GUI, I moved from spreadsheets to GnuCash [1] a few months ago and it's been great so far!

[1] https://www.gnucash.org/


Yes, echoing the enthusiasm for gnucash! I'm just passing 3 years tracking every credit card purchase over to investment allocations in gnucash.

At the end of the day, double entry accounting is double entry accounting and you should be able to move transaction journals between the tools. I haven't tested any of these, but it looks like there are various techniques / tools that make gnucash <-> ledger possible.

- https://wiki.gnucash.org/wiki/Ledger-CLI

- https://github.com/icyflame/gnucash-xml-to-ledger-dat

- ...


I built a service that incorporates plain text accounting [0] into a larger note taking system [1]. The service has mechanisms for repeating transactions and API access which I use for integrating that data into other systems or sending to my accountant.

One of the revelations was that the accounting system could be used for a few different types of commodities: time, effort, inventory, etc.

[0] https://tatatap.com [1] https://tatatap.com/beans


I've been using ledger for the last 5 years. I started playing around with it when I got tired of Mint failing to connect to 1 of my accounts and it lacked support for several others. My primary drive to use Mint was to have 1 place to view all of my accounts. The analytics to show spending on groceries vs restaurants was a nice-to-have. I'd never been fully comfortable with the security model but I didn't have much money at the time.

If I had to summarize my favorite features I'd say:

1) Strong support for multiple currencies/commodities including cost-basis,historical-market,current-market price conversions.

2) Advanced reporting options to support various filters, mutations, conversions, outputs. One of my favorite reports is total net worth in CAD converted using latest market prices

  ledger bal Assets -V -X CAD
Another might be top expense accounts in decreasing cost:

  ledger bal Expenses -H -X CAD --flat -S -T
3) Error detection: by enforcing double-entry accounting it has helped me identify hidden fees. It also helps when I make a mistake balancing a transaction.

4) Better than 2 decimal precision. This helps with crypto where your crypto balances can look something like 1.23456789 BTC


I scrolled around for 5 minutes looking for a link to a basic example document and never found one.


The file format for ledger is very simple, it's literally just a list of transations formatted like this:

    2021/01/12 Grocery store
        Assets:Checking   
        Expenses:Groceries   $50
This transaction means that you spent $50 at the grocery store. It's double-entry bookkeeping, so the transfers always balance: "Assets:Checking" account is reduced by $50 and "Expenses:Groceries" is increased by $50. This entry is equivalent to the previous one.

    2021/01/12 Grocery store
        Assets:Checking     -$50
        Expenses:Groceries   $50
But this entry is invalid, since it's not balanced (it's the accounting equivalent of a compiler error, and ledger will throw an error when parsing this):

    2021/01/12 Grocery store
        Assets:Checking     -$75
        Expenses:Groceries   $50
A ledger file is literally just a list of these transactions. Accounts are created the first time you use them in a transaction. Transactions can have more than two associated accounts, but they still have to balance. There are many more advanced features, but this (along with some basic understanding of accounting) is all you really need.


You have to click on some of the links. Check under docs, you'll find details about several different systems that are all under the umbrella of "plain text accounting". It's not one app. They have links to information on ledger, hledger, and BeanCount which all work similarly but are not (entirely) compatible (in particular, I know there's a common subset of both ledger and hledger which covers most personal accounting needs, but they each have some features the other lacks, never used BeanCount).

https://plaintextaccounting.org/#docs


Good feedback. It's hard to know where to stop adding to this wall of text, also each tool has its own format. But, point noted, thanks.


Different people learn in different ways, but I tend to always want to jump straight to an example I can pore over before reading the docs.


Cudos to the website for clearly stating WHAT THE WEBSITE IS in the very second sentence. This kind of clarity is unfortunately quite rare.

> This site collects FAQs and a directory for the PTA community...


I use ledger-cli + ledger-guesser [1], which uses use machine learning (brain.js) to classify entries automatically.

I've been relying on this for the last 3 years, it works very well.

[1] https://github.com/j3k0/ledger-guesser


That's a nice tool, this is a feature I enjoyed in Mint-like proprietary tools I used to use previously.

What's your workflow with it? Do you run `ledger-guesser <transaction details> >> journal_file.txt`? I'd somewhat prefer typing out the details in an editor, but I suppose I could type a bunch of transactions one per line in a file and xargs that into ledger-guesser.

What does it do when your transaction is of a new type that it wasn't trained on? Does it have a confidence threshold below which to tell you "I cannot guess this one"?


I never run it manually.

I plug this tool in my scripts that import transactions from banks (and stripe).

The scripts extract transaction details (amount, payee, currency), then they use `ledger-guesser` to create ledger entries and add them to the journal.

The generated entries are "uncleared". Then I manually "clear" the entries. Review. Commit. (You can also use a tag for reviewed transactions if you already use ledger's "cleared" indicator for something else).

For the best results, I have 1 journal per bank account. So I have different training data for each bank account.

There's no confidence threshold. When there is a new type of transaction is encountered, the guesser will chose the account with the highest probability.

The guesses are made based on the words found in the payee (and date). Unknown transaction have generally a few known tokens. Example: "INCOMING TRANSFER FROM NEW_CLIENT"... The classifier will probably classify that entry as "Incomes:OurLargestClient". In that case I have just to fix that entry to change the client, all the rest is good, it still saves a good amount of typing.


Anyone here tried both ledger and hledger? I read up on the docs, and would like to try one, but wanted to hear any colloquial experiences of usage before I dove in.


I liked that hledger had a few reports that ledger didn't have, like real balance sheets and income statements. Both integrate well with emacs, but their journal files differ in slightly incompatible ways, so they're not drop-in replacements. Both are very fast.


I’m going to chime in despite being a broke college student. I’ve been using ledger for about 2 years now, and daily reconciliation of what I actually spent is more helpful to me than having a budget, or anything else, it forces me to acknowledge how much I spent, and on what. Personally, it short circuits the easy swiping of plastic that leads to a ton of unnecessary spending, kinda like using cash.

Ledger has budgeting features, allows me to use multiple commodities (I even wrote a script to get stock prices and help ledger value them). I can’t comment on bigger things, but for my use case, I really enjoy it.


What banks / credit cards do people use that have great APIs or tools for exporting transaction level data?

The biggest thing holding me back from something like this has been the overwhelmingly boring amount of data entry required.


In European countries, banks are forced to provide CSV files for the transaction lists. Though the columns are different between banks,the importer function (of gnucash) is usually capable of handling the fields flexibly.

The rest ist just batched categorization by searching and applying.



Welcome again, HN friends! More past discussion: https://hn.algolia.com/?query=plain%20text%20accounting&sort...


Currently for finances, I tend to prioritize and "reduce and simplify" and habitually look at all costs as "do I really need this?" as they relate to my long-term goals. But in the future I hope to need more accounting knowledge (doesn't everyone on HN want to start a business? :) ... so I'm glad to hear about all this.

One of the "plain text accounting" apps listed at plaintextacconting.org (under "perl", from a prominent OpenBSD person) that uses similar vocabulary to describe it, and mentions looking at ledger somewhat and why he decided to write his own. (I mention it partly as a future reference for myself in case I want to compare them more later, or if someone already has.)

Also, a prior HN discussion (which, now I see, they have a link to a list of them at the original post's site; oh well): https://news.ycombinator.com/item?id=12119050


It's been a while since I looked at Plain Text Accounting but I want to do one thing I couldn't figure out how to do. Maybe someone here has ideas?

Cross Account Budgets[1]. I want to assign every cent coming in to a budget but the budget shouldn't be tied to a specific account as money can come in on multiple accounts but I want to model the "real" situation at the same time and assign the money to a bank account.

[1] Described in this old mailing list post: https://groups.google.com/g/beancount/c/ddi5fOuAFoU/m/jp3d0M...


You don’t have to overcomplicate it, just assign an expense to an account as you record it and account for it in your budget separately.

If you have two checking accounts that you use for Gas for example, you would credit the appropriate bank account the money came out of at the time of purchase and debit the appropriate expense account in the General ledger. What you see in the Expense account will then reflect how much money you spent on Gas no matter which checking account you used. You can then compare this to what you budgeted for.

EDIT: Here’s the appropriate PTA page on how you can use these tools for budgeting, but these are just tools. The General Ledger can reflect as much or as little data as you want it to, and the quality of the reports they generate will be based off that.

https://www.ledger-cli.org/3.0/doc/ledger3.html#Budgeting


Thank you. Yes, that's one way of doing it but that's a manual step. I'd like the expense and budget to be combined (been doing that for years in Excel and it works for me).


I use Google Sheets for bookkeeping because I found integrating with "plain text" tools on the web was really weak when I started my business in 2016.

I wrote this doc describing my method,

https://docs.google.com/document/d/e/2PACX-1vS7EzDgEt9_cQ5lc...

The idea is to record every transaction as between exactly two accounts. This is a little tricky with real-world transactions but it can be done, e.g., a real-estate purchase involving 8 accounts.


This is a well-written FAQ. In particular, the "Objections and Concerns" section seemed to predict my questions as I read through each answer (I do not do this type of personal accounting).


Something people reading this would probably be interested in is Recutils: https://www.gnu.org/software/recutils/ . It combines Human readable and writeable plain text with the ability to handle relational data and programmable manipulation. For databases under ~1GB it combines the best of plain text and sql.


For people that mention software like Ledger, Excel and Google Sheets to do their accounting, what do you do to make sure you don't accidentally delete/duplicate/edit a transaction and how do you import the latest transactions in an automated way?

For example, I started using FreeAgent for taxes and the game changing feature for me is the (Open Banking based) transaction feeds where transactions are pulled daily from multiple bank accounts, where you're prompted that you need to explain/categorise each new transaction and the explanations + transactions get locked-in once they become part of a submitted tax return.

You can easily change the category of a transaction in the UI but e.g. deleting or modifying a transaction amount will require multiple steps and for you to ignore loud warnings. The automated import takes care of avoiding duplicates and making sure nothing is missed compared to doing it manually.

I've done accounting with just spreadsheets before and I hated how easy it would have been to make an accidental edit and not notice. Manually exporting and importing CSV files is fatiguing and error prone as well.

I find this similar for invoicing software: you could keep a spreadsheet of who you need to invoice, if you sent it, if it's been paid, sending late reminders etc. but there's a lot of freedom to make mistakes and mistakes here are high impact. Invoicing software automates many of the steps, forces you to follow a set process and gives loud warnings if you deviate or make unusual edits.


Versioning: I use git to version my ledger file.

Preventing regressions: Every time I update with the latest transactions I close the last transaction with an assertion that ensures the balances are correct. (E.g. that the balance on checking is equal to the latest statement, or that outstanding VAT is 0 after paying taxes)

I’ve been using ledger for my (small) business for about 5 years now. I’ve a script that calculates all the figures for my quarterly VAT submission by the categories that the tax authority requires (I use tags to label transactions).

Importing transactions is still manual work, but given the low volumes it’s not a problem. I do find it frustrating that most banks are still so limited in providing API access to accounts.

Invoices are a bit special, I can see outstanding amounts under Assets:Receivables, but haven’t found a good way to track this easily by invoice.


One way you can make sure you don't inadvertently make changes is to use assertions, similar to how you'd use assertions in a programming language. For example, you can enter a balance assertion that's identical to the month-end balance on a paper statement you receive. If you somehow later mess up transactions somewhere so that the assertion becomes invalid, plain text systems will let you know.

BTW, I think one of the main differences between Ledger/hledger and Beancount is whether assertions are interpreted per-file or globally.


> For people that mention software like Ledger, Excel and Google Sheets to do their accounting, what do you do to make sure you don't accidentally delete/duplicate/edit a transaction and how do you import the latest transactions in an automated way?

I make sure by reconciling my accounts weekly (verifying them against the actual bank/brokerage accounts). I don't import automatically, I found that that led to laziness on my part. The value proposition of this style, for me, was better awareness of my money (not a vague, "I have enough" or I have around $xxxx in my checking account and $xxxxx in my brokerage account).

However, there are tools to bring in transactions automatically and I did use them for a bit. There are tools that offer support for OFX, CSV, QIF and others listed on the linked page. I found OFX (not just with this, but in general) to be inconsistent across banks, and, when I did things "automatically", made it semi-automatic. I'd download the CSV of transactions and import them.


> what do you do to make sure you don't accidentally delete/duplicate/edit a transaction and how do you import the latest transactions in an automated way?

I've never really had a problem with accidental deletions, duplications, or edits - it's a text file, and a transaction is at least 3 lines long (date and two postings), usually followed by a blank line. It's not like a CSV where the entire thing fits on a single line, and all the lines kind of blur together because they're so similar.

I commit my ledger file to git weekly, but that's more of a backup than anything else.

I manually enter all my transactions, so data import isn't really a problem I worry about (though I know ledger / hledger have ways of doing that).


>For people that mention software like Ledger, Excel and Google Sheets to do their accounting, what do you do to make sure you don't accidentally delete/duplicate/edit a transaction and how do you import the latest transactions in an automated way?

My general workflow is:

1. Pull tx data from bank websites, mostly via some hacky web browser automation scripts which log in and download the appropriate QFX/CSV.

2. Run `bean-extract [args] && bean-file [args]`, which processes the tx logs into a beancount file of newly seen transactions, and then move+renames the original files into an archive.

3. Copy entries from the generated beancount file to my permanent ledger via my favorite text editor. The processing rules I have (which get run during bean-extract) are comprehensive enough that this is mostly just copy-pasting large swaths of text to the appropriate section (e.g. "Balance Transfers", "Employment Salary & Benefits", "Everyday Expenses"), but I'll usually have a couple odd expenses which don't get automatically categorized.

4. Add a `balance` assertion for any accounts which have new transactions--this throws an error if my current calculated balance for that account doesn't match the assertion.

5. Run fava to check for errors and view any reports I'm interested in.

6. `git commit` the whole mess.

In general, (3) is only adding new text so it's hard to make deletions/edits by accident, and (4)+(5) give a strong guard against duplicated/missed/incorrect entries. (6) lets me glance over the diff before committing, mainly to confirm it's an append-only operation (unless I changed the name of an account or something like that, which is both rare and can be done in a separate commit to keep things tidy).

At the end of the day, the amount of supporting code I have for all the automation is around 1k lines, and it's been built up pretty slowly over the years--the initial automation got set up incrementally in order of how tedious I found various bank websites vs. the volume of transactions for the associated accounts, but at this point I can mostly just copy-and-paste my previous work on the rare occasion I need to set up a new account.


The advantage of text-based accounting is that files can be version controlled, just like software. I am using git and commit whenever I have a consistent state, as verified by (lots of) balance assertions.

In some sense, git commits are "meta transactions" for my personal journal, leading from one consistent state to another consistent state.


Feels pretty surreal reading these comments. I’m an accountant by day and toy with tech after hours.

I have absolutely zero interest in tracking my finances via ledger - unlike the programmers here apparently. Mirror opposite in a way


Do you track them at all using some other tool?


I don’t track it at all.

Living far below my means and couldn’t be bothered to record every single thing. It’s all on the bank statements anyway

The value add decision happens when you decide whether to incur the expense at all, not by recording it


As someone who is building an ERP solution right now, this could serve as the backbone for the accounting subsystem, which is the core of all ERP solutions. It makes creating an accounting solution less scary.


This recalls me of a code I wrote: https://github.com/clamiax/sw

It may be worth to dive deep into Ledger concepts.


Do programs like these essentially re-compute balances from the entire transaction history any time that it is asked for up-to-date information? Does it cache anything?


I am not aware of any that does. With modern hardware, and in a personal finance context (a few transactions per day), it is unlikely you will have too much data to handle. The algorithm to compute a balance is O(n) with the number of transactions, or O(nlogn) if the tool allows for unsorted input.

If required, you could always close a balance in one file and start with new accounts in a new file, sharding your journal by year, for example.


It would be good to measure that for the various tools. Things like balance assertions, balance assignments, valuation, may complicate the picture. hledger and beancount users, at least, do often split files by year to keep things in the "pleasantly fast" range.


> If required, you could always close a balance in one file and start with new accounts in a new file, sharding your journal by year, for example.

When I was using double entry accounting down to individual grocery items in GNUCash, I used to do this just for my own sanity.


Essentially yes, with some exceptions:

Ledger used to save a parsed/processed file to speed up subsequent reads. It was dropped as not being worthwhile.

Long-running UIs, like hledger-ui, hledger-web, and fava I expect, do the parsing only once, though the report calculation is typically repeated on each page load.


I recently started using Firefly-III and I am hooked. I wish I had exported csv data from all my banks, but 3+ years of transactions is still a great insight


I really want to be a good person and track my finances like this, but I just don't have time (or am too lazy) and just need a more automated process.


I use an XMPP Bit to track my spends in cash and then later import it. Anyone else using something similar?


For emacs users, check out ledger-mode.


Anyone have a good recommendation for text-based time accounting?



Ledger has some built in: https://www.ledger-cli.org/3.0/doc/ledger3.html#Time-Keeping

There's also Timewarrior from the Taskwarrior people: https://timewarrior.net/


Would using ledger & friends, with “hours” (and, with preset exchange rates, minutes and seconds) as commodities work for your use case?


That was my first thought, but my brain loves reinventing wheels.


hledger has provisions and advice on the docs (iirc) for time accounting


Accounting rules in Sweden does not allow erasure of history. That is too easy to do with plain text. This can work for personal accounting but not for cases where it is legally required.


Making it technically impossible to erase history isn't something any accounting software today does. You could get close to it by publishing data in a blockchain, but nobody does...

So, given that, the requirement must simply be to make erasing history too hard to do accidentally. A simple git commit history would suffice for that. Or just a check when you save the file to see if any lines have been removed.

It doesn't seem necessary anyway though - If everyone keeps a record of every incoming and outgoing transaction, then if I alter a transaction retrospectively, it will no longer match the counterparties records, and my modification will be detected.


A lot of software do make it very difficult, if not impossible for a regular accountant to erase history. To the point, when I was an accountant, if I made a simple error in keying in something, you would have to reverse it out, and then fix it, all of which would show up on the general ledger.

For example, say we received cash 5,500 for our software services that we have yet to complete, we would need to debit cash and credit some Accounts Receivable.

lets say I make a mistake:

Cash.....5,050

Accounts Receivable..........5,050

I would either need to do another journal entry for 450 dollars to both accounts, or reverse out them and do it again, of which it would still be visible


It cannot be made technically impossible of course. But it can be made impossible using the regular user interface.


So it really depends on what one consider as the regular user interface.

One could easily write a small (web or desktop) application that takes some plain text, appends it to a ledger file and creates a git commit. As well as only providing a read-only view to the ledger.


Simply managing the text files with git would solve that retirement


Not really. Git's history is 100% fungible, you can mix and match git's history like a swiss army knife. There are VCS's out there that have unfungible history. Fossil SCM is one such VCS.

Git is an amazing VCS swiss army knife. That doesn't make it the best tool for a given job.


No it wouldn't. It would provide history, but it would not prevent you from changing a transaction that was booked the previous month.


So don't change it? The audit trail is there.


Depends on if authorities agree with that point of view. Accounting here needs to follow what can be translated as "Generally accepted accounting principles". If you do bookkeeping with pen and paper, you cannot erase a past mistake. You need to correct it with a new transaction. Basically, an append-only system is needed.


I don't really see how this is practically different from any other "accountant approved" software. Even if the user interface is "append only" you can modify the saved data whether it's saved in plain text, binary blob or a SQL server.

On pen and paper you can copy a new falsified ledger and throw away the original. I think that's fraud, so good luck with it.


If you do bookkeeping with pen and paper, you can throw away the page and replace it with a new piece of paper.

The security mechanism is out of band - you keep the pages secure, and you also reconcile / audit your accounts with those of your bank, suppliers, customers, etc - it's never 100% within the medium of the accounts themselves.


But it being plaintext you can host it as git project on gitlab with a protected main branch that requires merge request approval, meaning you have a two man rule (and four eyes) for every change.

You can't do that with quicken.


I suspect most people who use this type of tool keep their accounts files in a version control system. (That's what I do)


Please stop post it. Plain text accounting is incredible as anything dead simple and plaintext but basically unusable. It's cool as idea, not as a tool.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: