From 22888f670f7b2fc1022aa42f90181d721ccfdeac Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 18 Jan 2021 14:03:46 +0100 Subject: [PATCH 1/7] posts: plaintext-accounting: add skeleton --- content/posts/plaintext-accounting.md | 77 +++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 content/posts/plaintext-accounting.md diff --git a/content/posts/plaintext-accounting.md b/content/posts/plaintext-accounting.md new file mode 100644 index 0000000..01d3b01 --- /dev/null +++ b/content/posts/plaintext-accounting.md @@ -0,0 +1,77 @@ +--- +title: "Plaintext Accounting, beancount, and fava" +date: 2021-01-15T15:54:51+01:00 +draft: false # I don't care for draft mode, git has branches for that +description: "Or the story of my fall into systematically logging my expenses" +tags: + - accounting + - cli +categories: + - software + - slice of life +series: +favorite: false +--- + +[Plain text accounting](https://plaintextaccounting.org/) is a way of tracking +your finances using simple text files and command line software. + +Being about to work on my end-of-studies internship, and therefore enter the +*adult*, *professional* world, I decided that I needed a better way to track my +income, expenses, and net worth. + + + +## My accounting journey + +* gifts +* credit card during high-school/CPGE +* joining the YAKA-ACU team + +## Why do I want an actual accounting solution? + +* some people use their head + * I used to do that for a long time + * I want more fine-grained control and analysis of my habits + * I'm somewhat of a airhead, suffer from one-click-purchase-syndrome +* some people use a spreadsheet + * bothersome + * easy to mess up + * hard to version + * I like `git` +* I want + * foolproof + * exhaustive + * powerful analysis, and trivia + * how much have I spent at my neighbourhood bakery in the last semester ? + * pretty interface + * FLOSS and forward compatible + +## Beancount + +### What is it? + +* python +* inspired by ledger, hledger +* simple +* *double entry accounting* + +### Why did I choose it ? + +* plain text accounting +* wonderful documentation + * first real introduction to double-entry accounting +* author's comparison with ledger and hledger +* I *grok* python + +### So how do I use it? + +* backlog of transactions +* fava +* simple makefile and git hooks +* mobile phone app + +## What's next? + +* not accurately tracking my taxes from my pay check +* not tracking my livret A, PEE, future PEL and AV From def0eb5551ef68ef0ecf6415e6fafde95ea6c3c9 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 18 Jan 2021 14:04:02 +0100 Subject: [PATCH 2/7] posts: plaintext-accounting: add history section --- content/posts/plaintext-accounting.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/content/posts/plaintext-accounting.md b/content/posts/plaintext-accounting.md index 01d3b01..4ea18c6 100644 --- a/content/posts/plaintext-accounting.md +++ b/content/posts/plaintext-accounting.md @@ -24,9 +24,26 @@ income, expenses, and net worth. ## My accounting journey -* gifts -* credit card during high-school/CPGE -* joining the YAKA-ACU team +I went through most of my life without having to account for my money +explicitly, making use of the "dad bank". I received small sums of money at +Christmas and for birthdays, most of which went straight to an envelop that my +dad kept for me. This is the money that I used to buy myself books, games, and +other small things during childhood. My father kept track of the money and told +me how much I had left whenever I asked him. + +During high school, my parents opened a bank account for me, and handed me +a credit card to allow me to buy lunch, make gifts, and other discretionary +spendings without having to explicitly go through them. It was regularly checked +on by my parents to make sure I always had some amounts of money to my name in +case I needed it, which they did up and until my engineering school. At this +point I had a pretty good idea of how much I could spend and when I could spend +it. This information could fit entirely in my head without any problems. + +Once I had spent a year at EPITA, I decided to apply to the team of teaching +assistants. Between the money that I earned during my internship and what I +was earning as an assistant, I was finally gaining some financial independence. +Until very recently I was still mostly keeping track of my spending in my head, +my student job allowing me to avoid explicitly budgeting my money. ## Why do I want an actual accounting solution? From 531c9e44fab2144cc0a7a3d78136e60e6e97be39 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 18 Jan 2021 14:04:23 +0100 Subject: [PATCH 3/7] posts: plaintext-accounting: add motivations --- content/posts/plaintext-accounting.md | 52 ++++++++++++++++++--------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/content/posts/plaintext-accounting.md b/content/posts/plaintext-accounting.md index 4ea18c6..565dce5 100644 --- a/content/posts/plaintext-accounting.md +++ b/content/posts/plaintext-accounting.md @@ -47,22 +47,42 @@ my student job allowing me to avoid explicitly budgeting my money. ## Why do I want an actual accounting solution? -* some people use their head - * I used to do that for a long time - * I want more fine-grained control and analysis of my habits - * I'm somewhat of a airhead, suffer from one-click-purchase-syndrome -* some people use a spreadsheet - * bothersome - * easy to mess up - * hard to version - * I like `git` -* I want - * foolproof - * exhaustive - * powerful analysis, and trivia - * how much have I spent at my neighbourhood bakery in the last semester ? - * pretty interface - * FLOSS and forward compatible +As you can see from my history, I have spent my whole life until this point +without using any form of accounting. Some people keep going their whole life +without ever explicitly using any accounting solutions, having a ball-park idea +of how much they have spent and how much they can afford to spend later. + +This, however, does not accommodate me anymore. I want to have more fine-grained +control over my money, and be able to track and analyse my spending. I also know +that I am somewhat of an air-head, and tracking my money explicitly will +probably allow me to avoid, or at least reduce, lifestyle inflation once +I finish school and enter the work-force. + +To that end, some people use a spreadsheet and simply keep track of their +transactions as a row of in-n-out flow of money. This is also problematic to me: +it is bothersome to come up with a useful template for budgeting, easy to mess +up my reporting, especially with transactions that are harder to model using +a simple template. Furthermore, it is very hard to version a spreadsheet, being +a programmer, and lover of the command line, I want to be able to use `git` to +keep track of my budget through time. + +The perfect system for me has to be: + +* foolproof: it is hard to mess up my reporting, and easy to know when I make + a mistake, +* exhaustive: I can use the same system to keep track of my money, my + investments, my debts, and anything that I would like to track, +* data-oriented: it should allow me to process my data and do some powerful + analysis on my past transactions: I want to be able to know how much money + I have spent at my neighbourhood bakery in the last semester. +* have a pretty interface and export abilities: this allows me to talk with + a banker or an accountant without them having to know how to use my accounting + system, +* be [Free and Open-Source Software][foss]: I can tinker with the sources if + something isn't to my liking, and more easily ensure that my data will still + be usable 20 years down the line. + +[foss]: https://en.wikipedia.org/wiki/Free_and_open-source_software ## Beancount From 3411fefd685c48a224d0df5b084e81ca8bed2cff Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 18 Jan 2021 14:35:03 +0100 Subject: [PATCH 4/7] posts: plaintext-accounting: add what-is-it --- content/posts/plaintext-accounting.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/content/posts/plaintext-accounting.md b/content/posts/plaintext-accounting.md index 565dce5..8fbc3e7 100644 --- a/content/posts/plaintext-accounting.md +++ b/content/posts/plaintext-accounting.md @@ -88,10 +88,27 @@ The perfect system for me has to be: ### What is it? -* python -* inspired by ledger, hledger -* simple -* *double entry accounting* +[`beancount`][beancount] is a tool to do [double-entry accounting][double-entry] +on the command line, using only plain text files. It is inspired by +[`ledger`][ledger] and [`hledger`][hledger], both respected tools in the [*plain +text accounting*][plain-text] community, from which `beancount` draws inspiration +both in their syntax and their philosophy. + +The point of *plain text accounting* is to make it easier and more efficient to +use the double-entry-style of accounting. This translates both in the syntax of +the ledger files, as well as the simplifications made to double-entry accounting +to make it seem more intuitive and easier to use. + +To be more specific about `beancount`, it is a tool written in Python, made to +be kept simple and effective by its author. It is both very powerful from +the get-go, and easy to extend thanks to a system of plug-ins using the dynamic +nature of Python. + +[beancount]: https://beancount.github.io/ +[double-entry]: https://en.wikipedia.org/wiki/Double-entry_bookkeeping +[ledger]: https://www.ledger-cli.org/ +[hledger]: https://hledger.org/ +[plain-text]: https://plaintextaccounting.org/ ### Why did I choose it ? From a4b3b7caef546f1cd0dfd8786d641b9788a8c0b8 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 18 Jan 2021 14:35:13 +0100 Subject: [PATCH 5/7] posts: plaintext-accounting: add why-choose-it --- content/posts/plaintext-accounting.md | 36 +++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/content/posts/plaintext-accounting.md b/content/posts/plaintext-accounting.md index 8fbc3e7..bfcf90e 100644 --- a/content/posts/plaintext-accounting.md +++ b/content/posts/plaintext-accounting.md @@ -112,11 +112,37 @@ nature of Python. ### Why did I choose it ? -* plain text accounting -* wonderful documentation - * first real introduction to double-entry accounting -* author's comparison with ledger and hledger -* I *grok* python +There are many different accounting solutions which I could have used, from my +list of wanted features one can presume that I would naturally align myself with +a double-entry accounting system: they are very powerful and make mistakes +obvious. + +Furthermore, my want for an easy way to version-control my ledger eliminates +candidates like [`GNUCash`][gnucash], which make use of XML or other +hard-to-version file format. The power of plain text accounting is that it is at +once easy to read, write, and version, but also that I can feel confident that +I will still be able to access my data in 20 years. + +So, at this, point we're pretty much reduced to one of the *plain text +accounting* software offerings. So why did I go with `beancount` rather than +`ledger` or `hledger` ? There are three main factors which led me to this +decision: + +* `beancount` has a wonderful documentation, specifically, I was first + introduced to the idea of *double-entry accounting* in its + [documentation][double-entry-beancount]. +* I read the author's [reasoning for writing `beancount` instead of using + `ledger` and `hledger`][why-beancount]: I found him very reasonable, and + agreed with a lot of his ideas (especially about being simpler, stricter, + and being independent of any transaction ordering) +* finally, I *grok* python: I can dive in the source code to understand what is + being done and why, I can write a few lines and submit a PR if I feel like + something is missing from the base package, I can write a plug-in to customize + it my exact liking. + +[gnucash]: https://www.gnucash.org/ +[double-entry-beancount]: https://beancount.github.io/docs/the_double_entry_counting_method.html +[why-beancount]: https://beancount.github.io/docs/a_comparison_of_beancount_and_ledger_hledger.html ### So how do I use it? From 2e5b5cc44b1fced211335f9fde0e9cddbc73ba93 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 18 Jan 2021 15:01:06 +0100 Subject: [PATCH 6/7] posts: plaintext-accounting: add how-to-use --- content/posts/plaintext-accounting.md | 38 ++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/content/posts/plaintext-accounting.md b/content/posts/plaintext-accounting.md index bfcf90e..00c5d71 100644 --- a/content/posts/plaintext-accounting.md +++ b/content/posts/plaintext-accounting.md @@ -146,10 +146,40 @@ decision: ### So how do I use it? -* backlog of transactions -* fava -* simple makefile and git hooks -* mobile phone app +I have only recently started using `beancount`, after having it been on my TODO +list for 6 months. As a New Year's resolution, I finally decided to bite the +bullet and start seriously using it. + +The first step was importing a backlog of transactions: I opened accounts to +represent my checking account, my cash on hand, my scrooge account (a special +service used by the TAs to trade money between each other and buy snacks), and +typed up how much money I had in each one. Importing the backlog allows me to +both give some context to the amount of money I am currently holding, and have +a representative set of transactions to open expense accounts and start +categorising my spending. + +The second step was setting up [`fava`][fava], which is a web-UI for +`beancount`. This allows me to check on my accounts from any point on Earth. +This meant that I had to setup syncing for my ledger file between devices, for +which I am using [`syncthing`][syncthing]. I have also had to make sure nobody +could access the `fava` interface, I have accomplished the task with the help of +[`Authelia`][authelia], which I had already deployed on my server to access the +`syncthing` interface securely. + +Finally I setup a `git` repository, added a [`git hook`][git-hook] to make sure +my ledger was [balanced][bean-check-hook], as well as a custom hook to make sure +that it was formatted. + +I am now able to input my transactions on the go using the [`beancount` android +app][beancount-android], and regularly using my computer to tidy them up and +commit them to the repository. + +[fava]: https://github.com/beancount/fava/ +[syncthing]: https://syncthing.net/ +[authelia]: https://www.authelia.com/ +[git-hook]: https://git-scm.com/docs/githooks +[bean-check-hook]: https://github.com/d6e/beancount-check/ +[beancount-android]: https://github.com/xuhcc/beancount-mobile ## What's next? From 76772e77991eccad4dbf28a345dca59ce0d7ebb0 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 18 Jan 2021 15:05:15 +0100 Subject: [PATCH 7/7] posts: plaintext-accounting: add what's-next --- content/posts/plaintext-accounting.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/content/posts/plaintext-accounting.md b/content/posts/plaintext-accounting.md index 00c5d71..c018042 100644 --- a/content/posts/plaintext-accounting.md +++ b/content/posts/plaintext-accounting.md @@ -183,5 +183,11 @@ commit them to the repository. ## What's next? -* not accurately tracking my taxes from my pay check -* not tracking my livret A, PEE, future PEL and AV +After all this work, the journey is still not done. It turns out that accounting +is kind of addictive. I am yet to be accounting for my taxes from my pay slips, +and still need to start tracking my *Livret A* opened by my parents, *PEE* +opened by EPITA, and other future investments. + +Finally, I will never be done with accounting, as there are only two things in +life that are for certain: *death* and *taxes*, and only one of them is +a one-time-thing.