Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Plain Text Accounting (plaintextaccounting.org)
127 points by pessimizer on May 21, 2023 | hide | past | favorite | 44 comments


I’ve been using hledger for a few years. I’ve tried Mint, Personal Capital, PocketSmith, YNAB, RightCapital, Tiller, and none of them ever give me a complete view of expenses because there’s always a problem getting data from one or more banks. All of these hosted tools use Yodlee or Plaid on the backend and there’s always a problem.

The common denominator, however, is CSV. Every service lets you download historical data as CSV, which can be imported by hledger and turned into journal files and then into visual reports.

It’s a bespoke setup and super nerdy and is a bit of a pain, but it’s literally the only solution that works for us.


I'll second hledger (well I use ledger but essentially same thing).

To add on for others, importing the data can be done with CSV, but the software itself has a lot of tools that let you automate your imports so you can categorize expenditures into accounts. This is all done via plain text file formats so it's very easy to get the end result you want using any combination of text processing tools you like.


Same here. I love hledger and have a few scripts to convert downloaded CSVs from various institutions into the appropriate format and dedupe any overlap if necessary. Once a month I download a bunch of statements, run a script and have all of the data available to me.


Wow, two posts about accounting at the very top of the front page! Must be a slow Sunday.

For my (extremely simple) accounting needs for my book writing, I looked at some of the packages, got turned off by the subscriptions, and realized I could do what little I needed just by opening a separate bank account, and doing all the costs & revenue through that. The bank takes care of the storage, and you can download a CSV of the whole year and import that into a spreadsheet. Some massaging and then give it to the accountant.

Obviously for a real business, you need something more, so I'm not saying this would work for everyone.


Reading the LWN post about why they chose GnuCash was a great reminder to me of why I chose beancount--all the other financial solutions out there did about 80-90% of what I wanted, but never 100%, and no way to get them to 100% either.

I'm not a programmer, so I had to install and learn a lot of tools along the way, but now there's literally nothing I want to do with my financial data that I can't. It's all just text files, python, git, csv, and json. I haven't encountered a single problem that I wasn't able to solve with just a bit of time and searching through stackoverflow or github.


Very true. A lot of these big systems expend effort on basic stuff (storing, displaying, dating, categorizing, summarizing) that's done just as well by other systems.

Also, your accountant doesn't need every transaction; just the categorized totals are good enough. He/she doesn't mind entering a FEW numbers in by hand.


> Wow, two posts about accounting at the very top of the front page! Must be a slow Sunday.

Or more people are feeling the cost of living squeeze and/or have been laid off and are trying to figure out their finances.


You can do a simplified budgeting this way - get a debit card and a few credit cards, and use one for food only, one for household expenses only, etc. Now you’re tracked monthly with no hassling with categorization.


Double entry accounting is a solid candidate for the most important economic invention of all time.

I've been thinking that there's some similarities between a network of double-entry accounts and joined semi lattices (like CRDTs). Is accounting the first widely used joined semi lattice?


many many interactive programs would serve their users best with this route -- file format first, UX second

proprietary apps can't afford to because 1) no moat and 2) really hard to get at files on mobile, but this ends up being a superpower for OSS if you can convince users to try your thing

better BYO-format structured document editors would help too


Getting at files on mobile is pretty easy these days. The business moat thing is 99% of it. They don’t want you checking out any time you’d like.


I have an iPhone, and it’s not always easy to save a file and then find it in an intuitive place.


It’s up to the app developer. It’s trivial to provide “Save File” and pick exactly where you want it to go.

The part that really sucks is when it’s “Save Image” and that is treated differently when sometimes you just want the file.


I’ve been using ledger for years. It works great. Just don’t show raw output to tax preparers. They won’t know what to make of it. You have to generate reports they can understand.


I wanted to echo the sentiment re: raw output vs. reports.

I've been using a self-developed double-entry accounting system for my own business. Generating the "big four" financial statements (income statement, balance sheet, statement of owner's equity, and statement of cash flows) in canonical GAAP form, along w/ a schedule of accounts payable and receivable (for converting from accrual to cash basis), has been enough to get our taxes prepared for almost 20 years.


I've been using ledger for over decade with a few tiny startup businesses. Once you get the hang of it and setup your own system and workflow, it's a joy to use. The first dollar I spend when kicking off a new business – or even the possibility of one – goes into a new ledger file. Much better than reaching for spreadsheet software or Quickbooks. Zero overhead, instant accounting. Love it.


This is a really good thing! I encourage you to use PTA by default.

However, I've found that I prefer GnuCash with the SQLite backend. This allows me to run checks and analyses on my finances with a shell script.

Yes, you could do this with plain text; that's why plain text is great!

I just prefer the SQLite way.


I wonder whether it’s possible to save data to SQLite for the transactional storage, and then automatically save to text files for interoperability.


There is a C plugin API, but I couldn't find a way to register callbacks on file save.

If there's not, I think I'll add it when I have time because it should be a fairly trivial process to convert to PTA format.


Related ongoing thread:

The end of the accounting search - https://news.ycombinator.com/item?id=36021197 - May 2023 (129 comments)


I bias strongly to text-only, by default.

For something to involve other media or forms it needs to be a strong clear net win. In my own software work I've coined a private term for it: CLIFMO (for CLIs First, Maybe Only.) Its not a novel idea by any means because I know hundreds/thousands of other engineers prefer it too. But I try to be religious about it.

For example, I've been making a new game lately, and the prototype is 100% text-only, and the final shipping version might be too. (NOTE: If curious, see my bio for details: Slartboz, a sci-fi post-apoc IF adventure.)


Guys, all of this amazing text based accounting software are very interesting to me. Does anyone knows if is there any feature for automatic registering of depreciation? If not, how to do not forget to register and how to keep track of all assets that will depreciate? Separated file?


I have just started experimenting with hledger, and then beancount this week!

My ideal setup would be YNAB, I really liked that program but unfortunately their current price is too high for me. So my plan for now would be to use beancount as normal (possibly with a telegram bot for entry + imports every week or so, with deduplication), as beancount has good existing tooling and is more strict than (h)ledger, and writing a frontend for budgeting on top, as that is not strictly part of the ledger itself. So that frontend would just make a weekly balance of expense accounts, and each could be mapped to a budget.


hledger can be strict and power users prefer that; like Ledger it's relaxed by default to help newcomers get started.

https://hledger.org/hledger.html#check


So what's next ? There's no documentation on how to actually understand each account, when to use,... accounting principles. Or is this software for accountants ?


GnuCash has an introduction that taught me everything I needed. [1]

[1]: https://www.gnucash.org/docs/v3/C/gnucash-guide/basics-accou...


It's not only for accountants (though we hope it can be useful to some of them too).

It's quite likely what you're looking for is missing, but have you seen

https://github.com/plaintextaccounting/plaintextaccounting/w... ?

There's also a bit at

https://hledger.org/cookbook.html#accounting-tasks


Why plain text over something like sqlite (or another similar open database).


I use SQLite. I used plain text for years but grew frustrated because it’s very difficult to edit the data in any structured way. Parsing is also difficult: there are always trade-offs between human readability, ease of parsing, terseness, and extensibility.


That's covered several times in the faq, but mainly to be human readable, editable, and future proof for any software to interact with.


Because you don't need a specialized interface (though you still can if you want). You can use any random text editor to interact with the files.


What is the point of making the data structure any more complex than:

  2011/03/15   Trader Joe's
      Expenses:Groceries   $100.00
      Assets:Checking
  2011/03/15   Whole Food Market
      Expenses:Groceries   $75.00
      Assets:Checking
I don't even need to explain the data structure to you, it is self evident. Any number of sophisticated functions can be built into an interpreter of the ledger data, but all of those complex functions never obscure the basic data which can be edited by hand in a plain text editor if desired. Or you can use ledger-mode in emacs and enter transactions through prompts so you don't have to manually structure the whitespace for it to look nice. However complex you desire, you can use ledger in that fashion, that is the strength of its minimalism.

Like I said elsewhere in this thread, I like to use ledger inside codeblocks in org mode (org-babel) in a simplistic application of literate programming. The extremely human readable nature of ledger's data structure is a natural fit for the similarly human readable org format, and in export of an org file into a website, html document, pdf or other media (via pandoc) ledger codeblocks remain human readable, even to someone who has never heard of ledger-cli. This means that an org file tracking a complex project with associated costs at each step (though ledger can track anything with units, including time) can be easily converted into a professional quality document that can be used in any number of contexts.

The professional outward facing document used for conveying information about a project to others can thus originate out of the same org file that is being used to work on the project itself. In other words, your notes are only a step or two away from a presentation in any number of formats.

When you want only the finances from the project file, just tangle it out and treat it like a normal ledger file.


I love beancount


> I love beancount

I've never used PTA software before, but I just tried beancount and I'm really liking it so far. Just set up my checking and savings accounts. The Vim syntax highlighting sealed the deal.

Looking forward to getting back on top of my finances…


How does it compare to ledger-cli? I've been using ledger for a long time, but heard good things about beancount and hledger.


I haven't used ledger-cli much; I ruled it out pretty quickly when I was testing PTA software. For me, I loved the reporting and hledger-add for entering transactions manually. As I learned to automate my input, I started to appreciate beancount's automatic strict enforcement, BQL, and fava web front-end. Then I learned some pandas and was able to replicate most of the hledger reporting I liked with my beancount data and some python scripts.

If I were in your shoes, my only question would be: am I happy with the output? If you are, I'd stick with ledger. If you're not, fava is pretty cool.


For clarity: "hledger-add" might be a typo ? Or is it that you used Ledger, then hledger, then Beancount ?


same. been using it for years now, and even wrote my own plugins for structures I used often


Any tips on sharing PTA with a not-so-technical spouse? I've been looking at beancount which also has a nice looking web app.


Mine uses hledger-web, with her own journal file on her laptop. I have installed a bash script that she can find/run from Spotlight Search, or double-click on if she opens the folder, which starts up hledger-web, which in turns opens a web browser tab, for data entry and review.

She has another script which can generate/update/open monthly year-to-date HTML reports.

At end of year (at least), I handle journal file rotation, apply any desired fixups, commit to version control, and produce some checked/cleaned-up HTML reports.

We also track some shared things in a google spreadsheet. I import from there to my own PTA journal each month, as an end-of-month adjustment.


Nice! Thanks for sharing. I'll have to check that out. I'm not great at hacking with Haskell (thus have been leaning toward Beancount), but a decade of running XMonad has convinced me of Haskell's merits.


I think ledger-cli is much more interesting in a literate programming style with it embedded into code blogs in org mode than just by itself. Not just for money either (ledger-cli can track anything with units), say you wanted to do a major home improvement project and needed a large amount of materials that may be used at multiple stages of the project. Ledger in this case is really useful as a way to tally up how many nails, boards, and other materials you might need. You can keep tallies of materials needed (and used) embedded into the broader context (what the materials will be used for) but still tangle out an overall tally of all materials needed and used.

Another example could be creating a meal plan for a long trip with many meals that you have to bring all the ingredients with you.

Ledger has so many more potential use cases than just as a way to track money, and ledger is so much more useful in org babel than by itself, it is an ideal compliment to org mode for managing large projects with lots of fiddly bits of defined types and units (which honestly can be time too, I kind of prefer it to org mode's clock system).


The meal plan example may be able to go even forward, because I think ledger-cli can also track your calories and macro-nutrients, apart from the ingredients themselves. I meant to do a calorie counting system in ledger-cli for some time, but did not quite get to it.


I am not really sure if ledger-cli has any capacity to create compound units, so that if you say log that you have eaten one potato in ledger-cli, you would also have to manually log the calories and macro-nutrients of that potato unless you had kept a template for that potato's nutritional profile you could copy paste somewhere right? I suppose you might be able to make a "potato" ledger file with its associated nutrient profiles and just load it from a code block every time you eat one. Idk.




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

Search: