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).> Later we loaded it into a script which would...
I too do not manually enter things in the ledger file (well, rarely). I actually enter it into KMyMoney, and have a script to convert to a ledger file.
Overall, your comment is coming across as a fairly weird complaint. It's a tool, and given that its in text, you're free to build whatever workflow you wish around it - including having people take notes on their iPhone and using a script to convert to the ledger format.
Btw, we tried everything: appstore apps, web forms, our own app. Everything sucks irl except just text. I still use this entry despite not having a database anymore for a script to load my data into.
Once a quarter I download CSV files from our bank account, credit card and Zoho app, and we have a set of ruby scripts that parse the CSV files into ledger files. They infer the correct accounts from the comment fields. Of course, the script and the ledger output tends to need a few tweaks, but it's >95% automated that way.
As a bonus the scripts also add a few sanity checks to the ledger file, e.g. ensure the balance matches what is downloaded from the bank and entries fall within the current period.
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.
The strategy I've used for different accounts/categories is to make accounts that match the expense categories that the Canada Revenue Agency wants on my tax return. Early on when I was getting into it I made a bunch of accounts for logical categories (Hosting Expenses, Prototype/Manufacturing Expenses, etc) but then after a few years of trying to map those categories into CRA categories... I just realized I could pre-categorize them appropriately and make my taxes simpler at the end of the year.
[1] https://marketplace.visualstudio.com/items?itemName=arcanis....
A good text editor of the future should recognize these base64 strings and make them appear like clickable files, but still let you right-click and go back to the plain text representation.
Additionally you can annotate a transaction with a "document" tag and that document will show up directly associated in the ui.
The ui has pretty good previewing for these. I add pdf versions of all of my statements, and attach receipts to specific transactions (business expenses, proof of paying taxes, etc.)
It works quite well
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.
And to be clear - I'm not sending the entire statement to Claude; instead, only the account name/narration of those transactions for which I already don't have a mapping. Claude then returns a well-formatted JSON that maps "amzn0026765260@apl" to "expenses:amazon", and "Veena Fuels" to "expenses:vehicle" and so on.
I can also pass in general instructions saying that "Restaurants and food-related accounts are categorized under 'expenses:food'", and it does a good job of mapping most of my dining out expenses to the correct account head.
The actual generation of journal entries are done by a simple Python script. The mapping used to be the hardest part, and what used to need custom classification models is just a simple prompt with LLM.
As someone who wrote a budgeting app, historical data > 1 year is a lot less useful than most folks realize. I would say at least 80% of folks never look back further than 6 months. It's not even worthwhile for comparing YoY as your lifestyle, the economy, etc change so much.
I ended up adding per-transaction opt-out roll up functionality for this reason, effectively squashing transactions into monthly and yearly budget summary transaction. Saved a ton of space with little loss of granularity.
If for some reason you care about your historical data enough to import it, you can add new transactions into "error" to subtract whatever part of it they are responsible for. If the account reaches zero, you can even cheat and delete all transactions.
I spent about a week defining a procedure to export all statements into CSV, converting the CSV into a Gnucash-friendly format where needed with some GPT3-authored PHP scripts. Once a month I do an import into Gnucash and the process takes at most 2 hours.
[0]: https://plaid.com/
I agree this niche needs a better solution than it currently has, although the commercial and regulatory incentives might not be well-aligned to force that. In my family we have important accounts in the US and in the EU (as well as less important accounts in Canada and Mexico), and I don't know of any personal use-friendly solution that lets me pull my data automatically from all of these.
I'd honestly like some nice integration between Plaid and Excel or GSheets to let me track capital gains transactions for my non-euro accounts in the weird way that German tax law requires (over a surprisingly broad range of accounts starting next year at the latest). But nothing turnkey seems to exist right now.
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.
If I had to submit one tip it would be to set everything up with a Makefile or similar. I keep my transactions spread across quite a few separate files for different accounts, and the actual commands I issue to include the right files are very long. Similarly I have various plotting and summary scripts whose exact syntax I don't usually remember. But with make I can just "make cashflow" "make balance 'A=Checking'" "make balance-plot 'A=retirement'" and so on.
If I had to submit a tip on top of yours, it's to use justfiles instead of Makefiles :-)
Since you’re here and clearly you know ledger well I’ll share a pattern I have that perhaps is a good idea or perhaps has an alternative approach.
We need to track customers and suppliers carefully and then assign payments both made and received to specific projects and categories within those projects. Invoices can contain a mix of these projects in either direction. So our workflow is:
- assign transactions to an account labeled by the counterparty when imported from bank account transactions.
- a script uses ledger print command and creates a 2nd journal file for each counterparty with a mirror transaction inverting the original transaction out of the counterparty account and into an Unknown project and Unknown category sub account as a place holder.
- transactions are then matched by bookkeeper to specific invoices and then assigned to Project:Category accounts in the counterparty journal file. transactions will be split if it’s needed at this point. so a single payment can be split to multiple Project:Category accounts.
- by including all bank transaction journals and all counterparty journals then ledger bal command show if all transactions have been processed by bookkeeping.
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?
Every damn time I reconcile transactions I end up fighting their system that I can't see the workings of or fix myself. It's getting to the point where the juice isn't worth the squeeze. I'd sooner deal with the CSV myself given a half-way decent set of tools to do so.
[0] https://hledger.org/1.40/hledger.html#csv
[1] No, they weren't willing to refund me any money; this is "typical", in their words.
I find it best to have a separate journal for each downloaded account. I just include them into a master journal (along with a manual entry journal) and generate reports from that.
I also use git so I can roll back the latest import, if something goes wrong - but that hasn’t happened yet.
Charts are not generic enough for my taste so I'm exporting data elsewhere, but for data entry it is great.
I like Paisa's ledger file editor, though other parts not working in my country, I'm fetching prices with a python script.
I wish its editor seperated into a library to be included in personal projects.
However, I'm not really looking for a layer on top of ledger as much as I'm looking for a configurable web-scraping system (using the local password manager) that can be run to get the csv/pdf/etc.. files needed to create the ledger.
I had plan to process these data and add to an accounting system, but didn't get a chance, and then my mobile crashed and I lost the Tasker action. Now I'm not getting any motivation to implement it again
* 2023: https://news.ycombinator.com/item?id=36022005
* 2021: https://news.ycombinator.com/item?id=28420797
* 2016: https://news.ycombinator.com/item?id=11164330
Various other mentions of the concept:
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.
Same for business expenses, I just pay with my card for equipment, services, etc. Later I report it up and get cash/transfer back (doesn’t work for some countries/businesses).
My personal eaten-shitten expenses I know from my bank and experience, there’s no need to account for these.
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
You must have financial motivation, not emotional. Once you know that if you give up on accounting, your buddy will happily drink through hundreds of bucks, or your company will get a free hdmi cable, you enter the damn sum without hesitation. Personal accounting doesn’t work because you only can lose analytics, not money.
- Tracking pending payment from clients
- Keeping track of my expenses in various sectors, food (groceries, eatout), books, magazine subscriptions, etc
- Keeping track of my current balance accounts across various currency deposits
- Loans I give to people, and gifts I give to people
- Creating virtual envelops to segregate my savings account money for my goals like travelling, buying gifts for someone, investment goals, etc
This has helped me tremendously
- for reducing my eatout habits and eating more at home by realising just how much I was wasting money by eating out daily, and inputting the saved amount into compound interest calculator to realize potential lost income and wealth from putting those into an index fund account
- to keep track of pending payments from clients and calculating my real cashflow against cashflow based on expected income
- reduce my impulsive spending, by tracking my savings account money with virtual envelops aka 40% for investment goals, 1% for gifts, etc, it helps me to not just see a big balance on my account and start spending it away seeing that money as segregated chunks in my mind helps me stay in my lane.
- I have a program that generates all sorts of charts to track my wealth growth over time, expense growth and decline across categories, which I then dump into a webpage with my notes on how the changes were a net positive or negative outcome on my life, I do it annually to decide what i’ll do next
- I also have a python script that takes my ledger file and converts it into an excel sheet to send it to my chartered accountant to file my annual taxes
I also maintain a separate ledger file for my business (I dont maintain that one manually, I just export the data from accountant’s software, to do my own calculations at home)
- I use it to calculate cashflow projections to predict how my expenses might potentially grow with rise in revenue
- Track categories of spending to spot anomalies in spend across departments
- Calculate whether I should hire more or raise marketing spend, calculate metrics like ROIC (Return on Invested Capital)
The double entry helps me catch discrepancies in accounting if any, by importing bank statements and generating a ledger from that, I have accounts separated by usecase (discretionary spends, employee perks, business inputs) , with each one getting deposit from main account weekly. I use that to calculate if somethings odd and books are all cool.
I have had trouble before with an accountant running pseudo expenses on my books without telling me, just to impress me by showing a high taxes saved, without being transparent, landed me in court once, with a huge fine with late penalties.
Now I dont trust accountants and make sure I double check no matter what.
Plus I have a lot of automation scripts and stuff, imports from stripe account, imports from bank statements, accountant’s own ledger, etc
I match them all with python scripts and try to look for discrepancies.
I love plain text accounting, as a programmer it works for me, I automated a ton of it, and I have tons of my own macros and shortcuts in my code editor(vim) to make things very easy and simple,
I love it overall, I built out my own system on top of hledger across the years.
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?
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
It’s actually the only thing I use emacs for.
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.
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.
Quickbooks online has gotten pretty good. I honestly wouldn’t recommend these plain text tools anymore. Quickbooks has become almost a standard.
I use Firefly III for my finances management, and in the end it is just much better to setup "dumb" rules that look for keywords in the description/IBAN numbers etc. I have about 30 of them and they cover 90% of my transactions.
On a macbook air m1, here's how hledger 1.40 from homebrew handles it (it used to be faster; perhaps this will improve again):
$ hledger -f examples/1Mtxns-1kaccts.journal stats
Main file : .../1Mtxns-1kaccts.journal
Included files : 0
Txns span : 2000-01-01 to 4737-11-28 (1000000 days)
Last txn : 4737-11-27 (990974 days from now)
Txns : 1000000 (1.0 per day)
Txns last 30 days : 31 (1.0 per day)
Txns last 7 days : 8 (1.1 per day)
Payees/descriptions : 1000000
Accounts : 1000 (depth 10)
Commodities : 26
Market prices : 1000000
Runtime stats : 80.23 s elapsed, 12465 txns/s, 2584 MB live, 7679 MB alloc
Ledger was traditionally faster on at least some reports, but I haven't been able to reproduce that on my machines for some time. Today, with the same file above, it ran for 40m before I killed it.Tackler advertises 56k txns/s: https://tackler.e257.fi/docs/performance
In my experience about half the time is spent on parsing and half on report calculation. Long-running apps like hledger-ui and hledger-web do the parsing only once at startup, saving time compared to CLI commands.
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?
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').
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
Don't be afraid to try them all a little; you can mostly-automatically convert between them.
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.
emacs org mode tables can even have formulas embedded in it and do rotations and automatic recalculation.
On average, it takes about 30-40 minutes per sitting to do a weekly review, and that's mostly checking g what hides behind amazon/ebay/Google payments.
So it's not that bad really
I think my ideal PTA would be some kind of jsonnet-based system where I can create/call functions to generate journal entries.
So I get a browser frontend with fava and data input in Excel.
It’s non-trivial, but then so is any form of accounting.
No one in their right of mind will want to manually edit the data store holding critical accounting data. 99% of the times should be ETL with the odd visual check for inspiration.
I hope you've at least once stumbled upon the existence of https://noyaml.com/ and/or, at the time, were familiar with the quirks regarding number interpretation.
What else would you want ledger to enforce? We actually have a few very specific (to us) rules we enforce, but we do that via a ruby script. That's the power of plain text accounting: you can just whip up a small script to do validation for you.
idk but this does not sound reasonable at all
It's rather hilarious, one of the major banks I had a conversation with back in 2019 (as these new laws were barely getting off the ground in tech implementation) noted that they had a service which allowed you to drop in raw SWIFT messages (interbank commmunication format) into a folder via SFTP to make payments in bulk or download bank statements. It's very real!
I wouldn't be surprised if they have a lot of big firms grandfathered into that, and may be still (unlawfully?) offering it.