12 ms·
Plain Text Accounting, a guide to Ledger and friends
- rguiscard 5y agoI’m using beancount to keep track of accounts in different currencies and stocks. Highly recommended. Tackler seems an interesting contender, though. The only weakness of plain text accounting is the lack of good graphic reporters.
- felixc 5y agoI've written a series of guides on how to use these tools in practice, here: https://felixcrux.com/blog/ledger-practices https://felixcrux.com/blog/ledger-practices
- teitoklien 5y agoHey felix , Your blog helped me tremendously a few months ago, to get better at managing my ledger files. Thanks a lot for all of your recommendations !
- felixc 5y agoHey! I'm really glad it was useful to someone. Thank you for the kind words :)
- jvanderbot 5y agoLedger has proven to be a huge improvement to my house finances. Just download statements, run them through a few scripts, and you have analytics-ready data.
- wsc981 5y agoJust looking through the docs of one of these apps called Ledger [0], it seems to me it’s a lot of work to keep everything up to date. I guess one could write tools to ease importing data from banks, brokers and the like. Currently I don’t do the full accounting stuff. I just keep track of my net worth using an Apple provided Numbers sheet. It’s easy and quick, just occasionally logging into all my accounts and then updating the values in the sheet. This way I don’t get the historical overview, but at least the data can be updated in just a couple of minutes. As long as I see my net worth rise over time, I am happy. —- [0]: https://www.ledger-cli.org/3.0/doc/ledger3.pdf https://www.ledger-cli.org/3.0/doc/ledger3.pdf
- ilammy 5y ago> it seems to me it’s a lot of work to keep everything up to date Unless you do dozens of transactions every day, it's not much of a hassle to keep track of them manually. If you're like a day trader or a small business owner then yeah, you'll probably need some helper tools.
- wsc981 5y ago> Unless you do dozens of transactions every day, it's not much of a hassle to keep track of them manually. I don't have too many transactions indeed. I am actually contemplating to switching from my Numbers sheet to the Ledger command line tool. I do like that this tool is multiplatform and based on simple text files. And it shouldn't be too hard to write a few scripts to convert data from my banks and brokers into the format used by Ledger. I guess I'd need a day to setup everything, so perhaps it'd be a decent weekend project. Eventually I would like to leave the macOS platform and not relying on Numbers would make the switch just a little bit easier.
- kqr 5y agoI actually switched from the plain-text hledger to a spreadsheet. I still do double-entry in the spreadsheet, but the latter was easier to use on the phone (0--3 transactions per day) and easier to share with other family members.
- hiq 5y agoIt looks like you don't feel like doing full accounting, in that case I'd say it's fine to stick to whatever you're doing. Accounting not done properly (e.g. with missing or incorrect transactions) is not (much) better than no accounting at all. In my case, I grew frustrated with my approximations. Computing the difference between my balances at different points in time hides the details that would make it actionable, or give any insight about past choices. So in practice I would go through my past transactions, try to get an intuition of what happened. At this point, switching to proper accounting is just about scratching an itch and making this whole process more efficient.
- hestefisk 5y agoDo all of these use a text file as the back end? I like the idea of a CLI, but it’s way easier running Tableau over an SQL database than a text file with indentation (just read the beancount review). I feel quite inspired by this regardless and will give it a shot.
- jolmg 5y agoIt's nice to be able to add comments, add a layer of preprocessing with a template/macro language, track changes with git, organize stuff in an arbitrary structure of files, etc. Stuff like that is not as simple if the backend is an SQL DB.
- amw-zero 5y agoYes - “Plain text accounting apps”
- smichael 5y agoCurrently yes. hledger has rudimentary SQL export (https://hledger.org/hledger.html#output-format https://hledger.org/hledger.html#output-format).
- jolmg 5y agoIt'd be cooler if the quantities didn't come formatted with thousands seperator commas and currency symbols. Then, the numbers could more easily be treated as numbers in SQL.
- smichael 5y agoI have not used the SQL output, but I hope it's like all other hledger output: the number formatting is configurable (following your data format by default, but overrideable).
- jolmg 5y agoYeah, but IMHO, while it makes sense to have configurable formatting for terminal output, it doesn't make sense to apply that formatting to output meant for SQL.
- hardtoreason 5y agoI've used the ledger-likes extensively, and they have two major problems: (1) One of the hard problems in personal finance is data capture and input validation. Programs like QuickBooks and Xero don't just hide the GL because they're being mean, they're doing it because even experienced bookkeepers make mistakes on the general ledger all the time. "Since it's a text file it's easy to read" solves exactly the wrong problem: you want it to be easy to write, and easy to write CORRECTLY. (2) They're the sort of solution that seems fantastic if you don't actually operate at scale. But once you start dealing with tens of transactions per day it simply is not sustainable. Safe to say: I'm not really a fan.
- jolmg 5y ago> One of the hard problems in personal finance is data capture With hledger and vim, I typically search and copy a previous similar transaction, then search and copy similar items. I have a keybinding to change the date, so like 3\d changes the date of the transaction I copied to 3 days ago. Overall, being proficient in vim, capture takes very few keystrokes. Since the files are plain text, I can easily e.g. list all products I've ever bought with a `grep | sort | uniq` pipeline, to check stuff like whether I put a product identifier under a wrong account or used different identifiers for the same product. Also, since the files are plain text, I can track changes with git. That gives me clarity over changes in the sense that I can make a large change (e.g. reorganizing accounts) over historical transactions and review the changes before committing. Regarding large changes, which I think is also a type of capture, I can easily make them with `sed -i ...`, vim macros, awk, etc. > and input validation After I've captured, running hb (which is a personal alias for `hledger balance`) results in hledger raising an error if a transaction is not balanced. I can also add an assertion `= X` to the end of account changes to assert what the account is supposed to hold after the change. The number comes from physically checking the account, whether that's by checking the bank app or opening my wallet and counting. hledger will raise an error when an assertion is wrong. > Programs like QuickBooks and Xero Being unfamiliar with QuickBooks and Xero, how would these programs do capture and validation better for me?
- croo 5y ago
- smichael 5y agoSite maintainer here. Thanks for the link! Suggestions are welcome for next time I'm tweaking the site.
- smichael 5y agoHere's my quick partial history of Plain Text Accounting (PTA), to catch you up: - 2003: John Wiegley creates the field with the Ledger command line tool and its file format. - 2007, 2008: I and Martin Blais create two new "ledgerlikes", hledger and Beancount, with their own technologies/priorities/maintenance styles. - 2003-present: Community grows; many helper scripts, tools, docs, and other ledgerlikes appear. - 2016: To grow the ecosystem, organise resources, and reduce support effort, I coin the Plain Text Accounting phrase and set up #plaintextaccounting IRC channel and https://plaintextaccounting.org https://plaintextaccounting.org. (And in all honesty, also to encourage objective comparison shopping and regain a little oxygen for Ledger alternatives). - 2017: Colin Dean sets up the plaintextaccounting subreddit. - 2021: The community continues to grow. The IRC chat is bridged with a Matrix room. Ledger has been "done" for many years but may have a new release soon. hledger has been steadily developing, with quarterly releases. Beancount is in process of a big rewrite. There are some other strong ledgerlikes, currently with much smaller userbases.
- natchy 5y agoI’ve never seems a timeline-view calendar in the terminal like here: https://github.com/SitanHuang/ledg https://github.com/SitanHuang/ledg What libraries were used to do that? I don’t see a package.json
- teraflop 5y agoIt's not complicated enough to need a library. Here's the code: https://github.com/SitanHuang/ledg/tree/develop/lib/cli/charts https://github.com/SitanHuang/ledg/tree/develop/lib/cli/char...
- sitanhuang 5y agoThx for linking to my project! I created it with dependency-free in mind so I don't actually use any library at all, hence the absence of package.json. Lemme know if you ever need any help with ledg!
- Chirael 5y agoIf anyone here, like me, is already trapped in the QuickBooks world, I wrote a small little converter for OFX to IIF to allow importing transactions while getting around the forced-upgrade-every-three-years cycle. Happy to share if anyone could benefit.
- qudat 5y agoIt's so funny to see this post on HN. I recently took the plunge and got rid of Mint for Beancount. I probably spent 10 hours getting things set up. So far I really like being in full control of the "database" via a composition of files. Even a database feels too heavy-handed for my personal accounts. It was a lot of fun to learn accounting terminology and methodologies like the double-entry accounting. The most annoying part of the process is being required to download CSV files from each of my bank/cc/investment accounts. I thought about building some APIs to be able to download this data automatically but some of my banks do not have publicly available APIs. That's hilarious to me because something like Mint or Plaid can get API access to my bank transactions but I, the owner the of the accounts, cannot. Not only that, but you can only download CSVs for the last 2 years. Mint/Plaid can get the entire account history.
- Infernal 5y agoPlaid does not get API access to your bank account. Plaid logs into the same interface you do and scrapes the data. It’s why account import in things like Mint, YNAB etc are so flaky. EDIT: It seems Plaid has negotiated API access with some institutions at this point, but historically has primarily relied on screen scraping.
- boulos 5y agoIf you're based in the US, I would recommend ofxtools [1]. Anytime an institution supports "Download in Quicken", they have an OFX endpoint that you can find via ofxhome. [1] https://github.com/csingley/ofxtools https://github.com/csingley/ofxtools
- bogwog 5y agoI used this a couple of years ago to create a script that automatically imports transactions from my bank account into my beancount ledger. Unfortunately, only one of my banks provides OFX access at all (for a monthly fee), and I learned I’m not disciplined enough to keep up with the other banks manually. Its annoying because I’m pretty sure the other banks do have OFX services somewhere, they just dont provide it to all customers, plus paying a monthly fee for the one bank that does just feels exploitative. A less reliable, but more accessible solution might be to parse emailed bank statements, but those only go out once a month, whereas OFX can show new transactions within minutes/seconds.
- prog5 5y agoSlightly off topic, but I finally broke down and paid for YNAB this year and it has literally changed my life. It doesn't feel like accounting anymore, it feels like playing monopoly. Use QB for biz, and tried mint for years, both feel like work. YNAB not only tracks historical categories but makes it fun to plan future expenses.
- gandhi00 5y agoYNAB is amazing. Couldn't agree more, it changed my life
- Tomte 5y agoI have used the old "lifetime" version. How is the new subscription software compared to it? Is it much improved? How?
- elastic_throe 5y agoThe biggest additional feature in the subscription based app is auto-importing transitions. Personally, this is not of interest for privacy / security reasons sharing my banking passwords. Recently added budgeting to the mobile app. Most of the user-facing improvements have been cosmetic to UI design, colors, and phrasing. The reports still are not at feature parity with the old YNAB4. Fortunately there’s an open-source Chrome extension - Toolkit for YNAB that improves reporting and charts. However, I find it disappointing this functionality isn’t built into the App.
- Tomte 5y agoThanks! Auto-importing isn't really a point for me, since YNAB has always only supported American banks. I think I'll reinstall old YNAB these days.
- dang 5y agoPast related threads: Plain Text Accounting - https://news.ycombinator.com/item?id=25745615 https://news.ycombinator.com/item?id=25745615 - Jan 2021 (200 comments) Plain Text Accounting, a Guide to Ledger and Friends - https://news.ycombinator.com/item?id=11164330 https://news.ycombinator.com/item?id=11164330 - Feb 2016 (26 comments) Edit: I've changed the submitted URL of the current thread from https://plaintextaccounting.org/#plain-text-accounting-apps https://plaintextaccounting.org/#plain-text-accounting-apps to the home page, which gives more information. See also https://hn.algolia.com/?dateRange=all&page=0&prefix=true&sort=byDate&type=comment&query=denominator%20list%20by:dang https://hn.algolia.com/?dateRange=all&page=0&prefix=true&sor...
- stadium 5y agoDo these scale for multi-user situations? Access controls, segregation of duties, etc?
- smichael 5y agoSome possibilities: * Use a version control system - keep journal files in eg a github repo; control access, manage pull requests, audit changes in the usual way. * Use multiple files - the journal can be composed from multiple files, each with different filesystem permissions/accessibility. * Maintain files on a server, and run a web UI like hledger-web or fava, perhaps behind a login form, to give read-only or add-only access to remote users.
- deleted 5y ago[deleted]
- account-5 5y agoAs someone who "manages" there accounts in spreadsheets what would be the advantages? I'm already downloading CSVs from my accounts which I clean and import into a spreadsheet. Also can someone link to what the actual text file looks like? The format. I can't find a decent example, I just want to see this human readable format, thanks.
- themmes 5y agoHere you will find an example and more format details https://plaintextaccounting.org/quickref/#h.8v2r9qqwt9f8 https://plaintextaccounting.org/quickref/#h.8v2r9qqwt9f8
- account-5 5y agoCheers mate.
- smichael 5y agoSpreadsheets have lots of strengths. I believe one of the difficulties is (a) managing an increasingly large number of transactions over time, with (b) an uncertain number of postings to (c) arbitrary accounts in a hierarchy. Though I haven't tried myself, I suspect modelling a full double-entry-bookkeeping General Journal in a spreadsheet just gets cumbersome. Secondly, while certain kinds of calculations and queries are easier in a spreadsheet, other kinds of queries and ad hoc reports are easier with PTA tools. Thirdly (big one), the plain text format lends itself to version control (good for data integrity and auditing), scripting and integration, and future-proofness. An example of Ledger/hledger's main file format: 2021-01-01 opening balances on january 1st assets:checking $1000 ; a posting, increasing assets:checking's balance by $1000 assets:cash $100 liabilities $0 equity $-1100 ; each transaction must sum to zero 2021-03-05 client payment assets:checking $2000 revenues:consulting $-2000 ; revenues/liabilities/equity normally appear negative 2021-03-20 Sprouts expenses:food:groceries $100 assets:cash $40 assets:checking ; a missing amount will be inferred ($-140 here)
- koevet 5y agoLong time beancount user here: in case anyone wants to give plaintextaccounting a try, I have created a semi-automatic transactions import tool for beancount, which categorizes transactions imported from CSV files: https://github.com/luciano-fiandesio/beanborg https://github.com/luciano-fiandesio/beanborg
- anyfactor 5y agoI really don't know for whom this is for. For Normal People: Double Entry even though may sound simple, it is quite a difficult concept to grasp. For the sake of double entry we use counter entries that take months to grasp. For example - Amortization, Allowance etc. More over double entry method strives for standardization of entries. Having a plaintext non-autocompleting solution without accounting for only handful fixed type transactions....I just could wrap my head around it. Moreover with online connected mobile solutions that are most of the time free why bother using this when the steep learning curve doesn't yield any marginal benefit. For Accountant: Excel is god and whatever accounting software the org is using is an acceptable solution --- Even though the FAQs and the previous discussion has addressed this exact same issue. I really don't know what type of people would use plain text command line solutions except for the sake of using plain text command line solutions.
- smichael 5y agoIt is a good question to ask. You say the FAQ has addressed it... I guess it was not convincing ? (If you remember where, please point me to it..) PTA tools, some of them at least, can scale well from beginner-level single entry accounting, or even zero entry "accounting" (just a list of dated event descriptions), to fully general double entry accounting that can model any financial event. I always encourage people to start out simple. What usually happens is they learn and become more interested and more sophisticated as time goes on. So I would say one group of people this appeals to is people who want to get their hands dirty with Double Entry Bookkeeping, with the support of a lively and enthusiastic community, in order to understand it better. Another is people who are expert with text editors, scripting and programming and want an accounting system where they can bring these skills and insights to bear. Another is people who want total control and privacy of their financial records. Another is people who want their financial data to be accessible and usable for a very long time (even without software, if it came to that).
- rambambram 5y agoGood reasons indeed. I'm not a user of this PTA, but a couple of months ago I decided to write my own simple bookkeeping software. I reckoned: if I have to learn double entry bookkeeping one way or another, I want to do that step-by-step with my own software. Just something running locally now. I also build in some (as I call 'm) Semi-Automatic Shortcuts, which let me enter standard recurring entries. Click-click-done. And the best thing: I now understand what this whole double entry bookkeeping thing is. Even for using of-the-shelf software from a third party, you need to learn the idea and skills behind double entry bookkeeping. The software is not going to fix that for you. P.S. If anybody is interested in a simple locally deployed PHP-script to do bookkeeping, send me a message. There's also a simple timetracker, a balance sheet, profit/loss statement, etc. You need a local server and MySQL database to run it. I guess in it's essence it's applicable worldwide, but if you're from The Netherlands, it's ready to do taxes for you.
- matheusmoreira 5y agoWhat is the best way to use ledger on my android phone? I need to be able to account for every transaction I make immediately after they happen. Sitting down and writing all this stuff into a file at the end of the day is just too boring. Anyone have experience with the apps mentioned in the site?
- subash_8848 5y agoI use Spendee to track expenses. They are using firebase so its quite easy to get your data with a script. I then use the expenses csv file along with other journal files. Expenses are most boring to enter and Spendee solves that nicely.
- shubhamkrm 5y agoI use Cone and Termux on my android device. My ledger journal is synced to a private git repo. When I'm away from my laptop, I just enter the transaction in cone, and push it via termux at the end of the day. It does have some limitations though, as cone is append only, it cannot edit transactions. For this, I've had to fire up vim a few times in Termux. I have also created a few scripts using ledger, gnuplot and termux-open to generate graphical reports, and have exposed these via termux widgets. This gives me a one-click access to real time reports on my phone.
- smichael 5y agohttps://hledger.org/mobile-apps.html https://hledger.org/mobile-apps.html PS a little daily-ish data-entry-and-reconciling ritual, with a pleasant tool setup, can be quite satisfying! I actually look forward to it. (That right there is part of my PTA success story. I used to suffer a lot of stress around all things finance.)
- djhworld 5y agoI mentioned this in another HN post from yesterday about beancount, one of the tools that uses this approach. My beancount file is nearly 3 years old now and I love it. Maybe it's overkill for personal finances, but I've tried countless other PF tracking tools and online services and none of them have the flexibility you get from tools like this. For example, tracking RSU vests, my house purchase etc. Combining beancount with Fava gives you a nice visualisation tool as well which auto updates when it notices the underlying beancount file has changed. I edit the file in Emacs using the beancount-mode, it's actually the only thing I use Emacs for but I have a bunch of custom elisp functions that add things to the file whilst I'm editing it. I don't bother with any auto txn importers, which does make it a manual process but it's like 10-15 minutes a week at most. Additionally most of my purchases are generally quite rote so a lot of them are just copy/paste from previous txns and modify the date and amount. This might not scale if I have a partner, but for now just Emacs + vim keybindings + a few custom elisp fns + a little patience works for me!
- xcambar 5y agoHow does that compare to GNU Cash? Also, I cannot and will not share personal financial data to yet another 3rd party SaaS. So please refrain from mentioning YNAB and the likes ^^
- xcambar 5y agoTo the downvoters: can you clarify how my comment triggered your downvote?
- globular-toast 5y agoMy ledger will be 10 years old this year. I don't use much cash, so data entry is handled by reading CSVs from my bank accounts and a machine learning thing I put together to "guess" what account the transaction is in (plus a fast auto-complete thing to correct the guess if it's wrong). I like that it's flexible enough to track all my assets if I choose to.
- jimnotgym 5y ago>Most (not all) plain text accounting implementations use signed amounts instead of debits and credits. This makes them "double entry light" perhaps, but it has been a rather successful simplification, intuitive to most newcomers. They shouldn't do themselves down. I am an accountant and I have used several large systems that do exactly this in the database. It is also by far the preferred way to export a trial balance or gl account from any system to excel. It is the norm in the industry and in no way an innovation of plain text accounting.
- cwp 5y agoWhen you say "it is the norm in the industry" do you mean that accountants are moving away from debits and credits, or is it just that accounting software translates to signed numbers when dealing with non-accounting software such as databases and spreadsheets?
- jimnotgym 5y agoIt is totally normal to display debits and credits on screen in gui software as signed numbers too. It is very convenient to be able to sum a list and find a balance. It also means that the sum of the entire ledger must always be zero which is a common consistency check that is applied. This is how it is in SAP, Coda, Sage and Netsuite at least.
- smichael 5y agoThanks for these comments, good to know!
- avodonosov 5y agoI used ledger / cl-ledger for some time, but they do not correctly support multi-currency accounting, which is a show stopper for me.
- smichael 5y agoDo you mean, in the sense of https://hledger.org/investments.html#a-more-correct-entry https://hledger.org/investments.html#a-more-correct-entry ? balancednoautoconversion validation may be relevant, if so (https://hledger.org/hledger.html#strict-checks https://hledger.org/hledger.html#strict-checks)
- avodonosov 5y agoI mean I want to log income, spendings, exchanges in multiple currencies (or commodities), and then be able to see reports in a single currency - my net worth, my income over period of time, capital gains / losses. Leger printed nonsence for such roports. I used to pay taxes in multi currency environment, and know the official rules here, in Belarus, how to calculate the indicators when converting to a single currency. Also I once came across US guideline for that - the same simple principle. So I guess that's a very standard aporoach in accounting. Ledger does something strange instead. I remember also some large blog post was circulating, where the author "explains" how to do accounting in two currencies, in some overcomplicated way, that only works for two currencies. This link was usualy shared between people as an ansver to the multi-currency question.
- smichael 5y ago> I mean I want to log income, spendings, exchanges in multiple currencies (or commodities), and then be able to see reports in a single currency - All the major PTA tools support this - perhaps the chat could help ? > my net worth, my income over period of time, capital gains / losses. The first two are easy, the third is more complicated but also possible - unrealized gains at least, I forget how easy realized gains are in the various tools, it might not be fully automatic.
- nlh 5y agoI've switched all my accounting over to hledger (a Haskell-based and slightly more feature-filled version of the original) and I'm SUPER happy with it so far. My primary consumption method is hledger-ui, a nice curses-based UI. It's got a `watch` mode so will update in real-time as you make edits to the source database, which is nice. The ONE thing I miss from the old QuickBooks UI world: Entering categories for transactions directly in my text file is tiresome. QuickBooks had a super nice auto-complete feature wherein it would remember the category as you were typing a transaction, which made data entry a snap. Anyone have any suggestions on how to replicate this inside a text editor? Or any other good way of quickly doing transaction entry?
- smichael 5y agoledger-mode in Emacs has some excellent account and description auto-completion (warning, may require a bit of configuration to suit your taste). hledger add, hledger-iadd and hledger-web are some of the data entry uis with auto completion. Alternatives: other ways of generating entries means less manual data entry, such as copy/paste in your editor, predefined templates (org-capture, yasnippet or equivalents), or conversion from bank csv data. [PS I realize now you were asking for more than account name auto-completion, ie: filling in defaults for all postings (legs) when you reuse a transaction description. I don't know of many PTA tools doing this yet; hledger add is one.]
- deleted 5y ago[deleted]
- Buttons840 5y agoI've experimented with classifying my own transaction history using n-grams and either naive Bayes or a neural network, the neural network worked better. I could train the nn to convergence in a few seconds and it was good enough to remove 95% of the classification work.
- mindslight 5y agoDoes anybody else feel that the hype behind accounting, especially double book accounting, is somewhat overblown for its actual substance? Every time I dig into accounting and try to learn it more in depth, it seems that the foundation is trivial. And it coasts on a few "clever" implications from the double book assertion (income/expense accounts), almost in spite of how they don't make sense. You can't classify an item as multiple expense categories without growing the semantic model, so why do you even need the concept of an expense "account" in the first place, as opposed to a single entry in your cash account, tagged with categories? Meanwhile the bulk of the real complexity revolves around tax rules, which always seem to get left out of "accounting" proper, even though they're the overwhelming reason people to go accountants. I actually installed QuickBooks the other week to see what the gold standard looked like, and it ultimately just seemed to be another way to keep basic credit/debit accounts, with little in the way of preparing/optimizing taxes. Its main value add seemed to be in generating paperwork (eg invoices), that while perhaps nice to formalize, would just increase my scope rather than solve my problems. I expected that it would have automatically prodded me into creating a depreciation schedule and things like that, but it appeared I had to set things like that up manually in terms of basic accounts? I'm asking because I see people talk about accounting as if they're getting a lot of value out of it. But every time I've dug into it thinking there must be something I'm missing, I've never ended up seeing that value.
- deleted 5y ago[deleted]