Plain Text Accounting (PTA)

iscream26 | 331 points

Systems that use immediate strict categorization don’t work for some people. At a company I worked at we went with a two-phase approach. A person would write notes (literally iphone notes) in the following format:

  Apr 5 24
  -50 Alice tools
  -220 Bob home project

  Apr 2 24
  +20 Bob returned loan
Note that time goes “up” to avoid scrolling too much on open. Later we loaded it into a script which would parse dates, detect keywords and make templates for proper double-entry. It would detect both the outer “agent” and the internal analytics and also put the original text as a comment. What it couldn’t detect had to be manually categorized and (sometimes) added to the script. Of course the script used editable lists for correspondence, not only hardcoded values. These lists were person-specific, so that Alice and Bob wouldn’t have to sync their vocabularies.

I cannot imagine any of the people at that company filling this

  9/19 (1234) comment here
    Cat1:cat2:cat3
    Cat4:cat5
every time money moves and they are in a queue, in the car, talking to someone, etc. They’d simply resort to smaller notes again in the notes app or in the chat, or would try to “remember” it, to fill properly at the end of the day (more likely week).
wruza | 4 days ago

I've been using ledger (ledger-cli) from the moment I first became self employed (almost twenty years ago). While far from perfect, I'm very happy about it. It's nice that everything is in plain text, which means that I can script things, read everything in VIM, and easily extract data. For one of my two current companies, the ledger file is 2MB of plain text and contains the transactions from 2016 onwards.

While I personally didn't find much value in lots of different "accounts" (categories), it's still been indispensable in keeping track of everything.

Learning double-entry bookkeeping (which tools like ledger use) was really fun (and not that hard in hindsight) and probably a skill that is useful for the rest of my life.

chriseidhof | 4 days ago

Plain Text Accounting has become significantly easier to do for me on a regular basis, thanks to LLMs. Specifically: importing bank statements into hledger and avoiding manual entry.

I use a JSON file to map bank entries to my hledger accounts. For new transactions without mappings, I run a Python script that generates a prompt for Claude. It lists my hledger accounts and asks for mappings for the new entries.

Claude returns hledger journal entries based on these mappings, which I can quickly review.

Then another script prints out hledger journal entries for that month's bank transactions, all cleanly mapped. It takes me just a few minutes to tweak and finalize.

I can also specify these mapping instructions in plain-language which would've otherwise been a fragile hodgepodge of regexps and conditionals.

jasim | 4 days ago

I've been using Beancount, really enjoyed learning it, writing tools for data import and having a hands-on experience with accounting. But it's been almost a year since I last imported data, I planned to do it monthly but it's a bit of a chore (it takes 30 to 60 mins despite a lot of it being automated).

RivieraKid | 4 days ago

I use ledger for all bookkeeping and accounting for personal and many LLCs. If you’re a terminal rat and cli master, use vim or emacs, sed/awk know the basics, script in bash/python/perl/ruby regularly then just learn ledger and double entry accounting and switch to it and I suspect you will be much happier than whatever you are doing today.

A few basic tips:

- reckon is helpful for importing transactions quickly. https://github.com/cantino/reckon

- use “include” to break up the problem.

- bal —-dc is something US accountants might recognize a bit. but more likely than not they are incapable of understanding negatives correctly in the way ledger uses them, so easier to just write a few scripts to convert it to DR CR style for them. I’ve been shocked at how little abstraction accountants I’ve dealt with are capable of.

alchemist1e9 | 4 days ago

I've written a series of posts on practical "recipes" for how to use Ledger (one of the leading plain text accounting systems) effectively in more complex situations beyond the basic tutorials: https://felixcrux.com/blog/ledger-practices

felixc | 4 days ago

Plain text accounting is cool but I think one of the biggest barriers for people is downloading bank data into a standard format.

The banks are never going to embrace much more than CSV or excel files... the various data aggregation platforms (yodlee, plaid, etc...) are not open source or hobbyist friendly.

Back in ancient times there was a company called Wesabe (https://en.wikipedia.org/wiki/Wesabe) that wrote software that did bank syncing on your desktop. Mint.com basically put them out of business but I still think about that approach. I think it could work for open source.

Has anyone else?

po | 3 days ago

I’d appreciate hearing how others have used the various plain text accounting tools for their own use. Are you legitimately using it to inform yourself of your spending habits and taking corrective action? Is it simply for tracking your expenses, revenues, net worth, etc? Or is it simply about the process? I can certainly see the appeal of such an orderly, structured process.

Every time I’m reminded of plain text accounting, I have either an irresistible urge to immerse myself fully into the process, or feelings of guilt for not staying committed to my previous attempts. Right now, it’s mainly guilt, since I’ve not updated my personal ledger in a month and a half. Ultimately, I think I’m unsure about why I’m using it, and eventually feel like I’m logging transactions just for the sake of it.

rpb92 | 4 days ago

The cookbook section is rather unfortunately named in the context of accounting :^)

notpushkin | 4 days ago

I’m a huge ledger fan (hledger specifically) and have used it to run my entire accounting life for the past 8 years or so.

A few tips:

* Resist the urge to break up your various accounts into too many separate files. I tried that and went back to one file per account per year (aka “venmo-2024.hledger”). Also helps with below…

* GitHub CoPilot is remarkably and shockingly good at working with ledger files. It will do the balance addition/subtraction on following lines almost perfectly. Also, if you need to manually enter a new line, you can often just enter a shortcut one-line comment and it’ll fill the entire entry, aka:

; 10/1/24 -$250 for new business cards

nlh | 3 days ago

I've wanted to explore this so that I've got records of all my transactions which I can feed to generative AI when it eventually becomes capable enough.

E.g. "Using my financial records, help me set a budget which allows me to do XYZ within ABC bounds."

I wonder if anyone else has done this yet?

kingo55 | 4 days ago

Is there an text editor that is able to autocomplete the categories in hledger format ? It would be great to type Assets:: and then get a list of the possible categories, but I haven't found any editor or extension that does it.

ecaradec | 4 days ago

I'm looking for a plain-text solution that also knows about inventory (counts, FIFO, dollar cost averaging) along with invoices/POs (AP/AR.)

Also, I wish they would use words like "debit" and "credit" instead of trying to hide this under +/- notation. It makes translating from real financial documents or scenarios into plain-text reports somewhat painful because we're not speaking the same language.

memset | 3 days ago

I love PTA and have been doing it for years, using beancount, fava and emacs.

The main benefit for me is keeping track of everything, including pensions, RSU vests and so on.

I have some scripts that help me connect to banks and translate the transactions into the correct format with some crude rules based categorisation, along with scripts that convert CSV files from investment accounts etc.

It’s a lot of effort at first but I’ve got the system down now to maybe 10-15 minutes work once a week to keep everything updated.

djhworld | 4 days ago

I just switched off of ledger because multiple accountants and tax preparers didn’t know what to do with it even if I hand generated profit and loss reports.

Quickbooks online has gotten pretty good. I honestly wouldn’t recommend these plain text tools anymore. Quickbooks has become almost a standard.

marcrosoft | 3 days ago

Wow, I had no idea accounting was such a big thing outside of like, actual full time accountants.

Doesn't using anything but some ultra well known service amplify the consequences of failure?

Like, isn't the IRS going to think any tech related error is more suspicious than if you had used some cloud thingy?

eternityforest | 2 days ago

Has anyone tried training their own personal machine learning model to take export from their Bank+receipts and auto categorize everything? It seems like it'd be a fairly simple classification model that wouldn't require too much training...

l72 | 3 days ago

Not entirely related to this but, I always wanted to download my transaction information from the banks and keep it locally on a periodic basis so that I can keep track of the transfers I have done to a sepefici account. From a business perspective this is very much helpful, but not able to find any free and opensource solution for it. Have done something using Python , but updating it in a periodic basis is difficult considering there is no API there to provide this data.

alwinaugustin | 4 days ago

How does PTA perform with a medium long ledger, say 1m transactions. Basic checks like summing the ledger, how long does that take?

jimnotgym | 4 days ago

for folks running their own businesses, have you managed to switch from xero to ledger/beancount? anything to look out for?

xero keeps raising their prices every few months, which is annoying (the whole attitude of 'you won't switch anyway, so we'll do whatever we want').

jmstfv | 3 days ago

Welcome again to PTA, HN friends!

I set up the plaintextaccounting.org site in 2016, to grow a more organised info hub and community around ledger (2003), hledger (2007), beancount (2008), and the many related apps and resources. I'm happy to answer questions; there's also a FAQ on the site.

I don't spend as much time as I'd like making the site and docs better. Feedback and help is always welcome. Stability, efficiency, and longevity are all important, which is one reason it remains fairly simple.

This style of tools and workflows for bookkeeping/accounting, which I named "plain text accounting" for convenience, but was first popularised by Ledger starting in 2003, has a number of aspects; it's not so easy to explain briefly. I think a key one is the use of textual domain specific languages for interacting with the accounting software's internal data model. I mean the various file formats of the PTA tools (describing data), and also the tools' command line interfaces and related scripts and idioms (describing reports or actions).

Textual languages are more expressive and flexible, version controllable, and modular/scriptable/glueable than GUIs, which tend to be more static in their capabilities. Note once you have one text DSL, it's relatively easy to add more, eg custom formats that better fit your needs. And such DSLs need not preclude GUIs; they can be an alternative (perhaps assisted by smart editors/IDEs), complementary, or a foundation.

-Simon

simonmic | 3 days ago

I see a lot of people in here using hledger or beancount over ledger. Could somebody explain the differences? Looking to get back into PTA, but am facing some choice paralysis now.

gibbetsandcrows | 3 days ago

In the past I've tried various free accounting tools, but sadly none of them could track account/card numbers (EDIT: while processing bank statement exports). I don't need to track my many bread and pastry purchases, but I'd like to track things like investments, split lunches, rent from flatmates etc.

I have multiple accounts and I need to track transactions between them, and also distinguish them for all other transactions. Could anyone here recommend a tool that deals well with this?

I'm partial to semi-ad-hoc plain-text bookkeeping, which I already do for other things, but I'd be happy for any recommendations.

dvdkon | 4 days ago

Emacs org mode is useful for this. Its plain text tables have spreadsheet capabilities and you can cross reference other tables, to separate out things.

zelphirkalt | 4 days ago

First thing that came to mind was org-mode’s tables, which are great. This feels like an Emacs package suite just waiting to happen....

binary132 | 4 days ago

Take a look at SimpleFin for exporting bank data in JSON.

djbusby | 4 days ago

I'd embrace plain text accounting more if it had a better schema. Ledger's is absolutely atrocious, and it drives my OCD nuts trying to use vim to "write" accounting entries.

I think my ideal PTA would be some kind of jsonnet-based system where I can create/call functions to generate journal entries.

candiddevmike | 4 days ago

> This means that the bank will need to provide you with a SFTP server and credentials to connect to it

idk but this does not sound reasonable at all

sulandor | 4 days ago