Plain Numbers (Linux Magazine hledger intro 2024)

1 Like

4 posts were merged into an existing topic: Plain Text Accounting (PTA) (Hacker News 2024)

Thanks again to Marco Fioretti and Linux Magazine, this is a great hledger intro!

Here are my notes, as promised on mastodon.

The multiplatform hledger can be used from a phone

I guess this is referring to viewing a remote hledger-web server in the web browser ?
Or perhaps running hledger in something like Termux on Android phones ?

Listing 1

I think the negative assets:bank balance here can create some confusion.
Is it just because these amounts are random ?
Or is it because of your personal sign convention (see below) ? But, assets:cash is positive.

money amounts must have a currency prefix (E for euro)

A currency symbol or name is usual, but not required.
(And of course € or EUR could have been used there, it didn't have to be E.)

expenses:food. E100

The period after food might be a typo ?

"2023/03/01 2023/05/15"

The other variants are valid, but not this one.

latest stable version (version 1.33.1 at time of writing)

1.40 now (on 2024-09-20).

you must download the corresponding ZIP archive from the website

Some of the binary packaging systems add the latest release pretty fast;
it might not be necessary to download a bindist from github.

(unpack instructions)

For the exact unpack instructions, the github release page will be the most up to date.
Eg Release 1.40 · simonmichael/hledger · GitHub > How to install > (your platform).

Listing 3

In recent hledger versions, weekly reports look best when you pick a monday as the start date
(for more readable headings).

hledger-web ... will exit as soon as you close that tab or do nothing for two minutes

To be precise: it will exit after two minutes of not being open in any browser tabs .

The Sign Problem

I was a little sad that you chose to use signs opposite to standard PTA practice!
It's a valid choice, but you could mention it much earlier, before the example outputs and charts ?

I'm also having trouble seeing the consistency in signs between listings.

I'm still not quite sure if signs were flipped in the journal, or at report time by using the --invert flag; so I'll just note that this flag exists, and is another way to see the signs one wants.

I had to use sed because the option to use another field separator didn't work.

I expected separator | to work, but it failed for me too.
Sorry about that, I have opened #2236.

pass it to hledger with the --rules-file option

I think you know this but since I see many people using --rules-file,
I'll just note it's not needed if the rules file is named like the data file with .rules added.

for every single line in my original journal, lines 8 and 9 generate a conversion rule for hledger.

And folks can see some more examples of csv rules in the manual.

I also need things (e.g., charts with the rolling average of some account over a certain period) that, as far as I can tell, are not possible with hledger without custom programming.

Possibly doable with -A/--average and hledger-plot (on Scripts page) ?

A few more notes for newcomers trying to get clear on this stuff:

Figure 7: What's wrong with this picture?

  • liabilities has the same sign as assets here. This is called a contra-balance, and is unusual in practice; it could happen eg if you overpaid a credit card.

  • All signs are opposite from the usual PTA convention, already mentioned above, but I verified that the accounting equation is satisfied here (it was hard to see):

    assets   + liabilities = equity  + revenues  + expenses  (appropriately signed)
    19451.44 + 908.53      = 2443.33 - 143024.99 + 160941.63
    20359.97               = 20359.97