# Hledger-lit: another hledger plotting thingie

**URL:** https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696
**Category:** General
**Created:** [December 14, 2025, 6:42pm UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696 "2025-12-14T18:42:55Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![adept](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/adept/32/36_2.png) [@adept](https://forum.plaintextaccounting.org/u/adept)
#### Post date: [December 14, 2025, 6:42pm UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696/1 "2025-12-14T18:42:55Z")

</div>

Building upon [hledger-sankey](https://github.com/adept/hledger-sankey) (which was previously discussed [here](https://forum.plaintextaccounting.org/t/hledger-balances-and-cash-flows-visualization/95)), I’ve made [hledge-lit](https://github.com/adept/hledger-lit), a Streamlit-based Python app that can plot various graphs based on the output of `hledger balance`.

---

<div class="post-metadata">

### Author: ![japhir](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/japhir/32/248_2.png) [@japhir](https://forum.plaintextaccounting.org/u/japhir)
#### Post date: [December 15, 2025, 12:48pm UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696/2 "2025-12-15T12:48:21Z")

</div>

Looks cool! I just tried it, with:

`git clone https://github.com/adept/hledger-lit`  
`python3 -m venv .venv`  
`source ./.venv/bin/activate`  
`pip install -r requirements.txt`  
`streamlit run hledger_lit.app`

but I get this error:

```auto
Usage: streamlit run [OPTIONS] [TARGET] [ARGS]...
Try 'streamlit run --help' for help.

Error: Streamlit requires raw Python (.py) files, not .app.
For more information, please see https://docs.streamlit.io

```

I’m on Arch Linux with Python 3.13.11

---

<div class="post-metadata">

### Author: ![adept](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/adept/32/36_2.png) [@adept](https://forum.plaintextaccounting.org/u/adept)
#### Post date: [December 15, 2025, 11:36pm UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696/3 "2025-12-15T23:36:25Z")

</div>

Right. That's a typo in the Readme, you need to replace .app with .py

---

<div class="post-metadata">

### Author: ![simonmic](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/simonmic/32/1_2.png) [@simonmic](https://forum.plaintextaccounting.org/u/simonmic)
#### Post date: [December 16, 2025, 7:12pm UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696/4 "2025-12-16T19:12:51Z")

</div>

I tripped on this too. Specifically, you need to rename that file:  
`mv hledger_lit.app hledger_lit.py`

---

<div class="post-metadata">

### Author: ![adept](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/adept/32/36_2.png) [@adept](https://forum.plaintextaccounting.org/u/adept)
#### Post date: [December 20, 2025, 12:10am UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696/5 "2025-12-20T00:10:16Z")

</div>

That's what you get when pushing in a hurry 🙂

This should be fixed now (both readme and a filename)

---

<div class="post-metadata">

### Author: ![adept](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/adept/32/36_2.png) [@adept](https://forum.plaintextaccounting.org/u/adept)
#### Post date: [December 20, 2025, 6:11pm UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696/6 "2025-12-20T18:11:11Z")

</div>

I’ve pushed a bunch of changes, and one can now define account categories using regexps, and all hledger commands for every graph are disclosed and customizable as well

---

<div class="post-metadata">

### Author: ![japhir](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/japhir/32/248_2.png) [@japhir](https://forum.plaintextaccounting.org/u/japhir)
#### Post date: [December 24, 2025, 12:39pm UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696/7 "2025-12-24T12:39:33Z")

</div>

This is really cool! I love the sankey diagrams. I’d also like to look into using the `--average -M` flags for the first two plots, so we get monthly average values rather than a cumulative total.

---

<div class="post-metadata">

### Author: ![Khaine](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@Khaine](https://forum.plaintextaccounting.org/u/Khaine)
#### Post date: [January 12, 2026, 9:54am UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696/8 "2026-01-12T09:54:05Z")

</div>

This is really cool. I'd also love some way to specify the depth of accounts. If you have a very deep number of sub-accounts then it can get very visually cluttered.

---

<div class="post-metadata">

### Author: ![adept](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/adept/32/36_2.png) [@adept](https://forum.plaintextaccounting.org/u/adept)
#### Post date: [January 12, 2026, 7:08pm UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696/9 "2026-01-12T19:08:20Z")

</div>

The current version allows you to fully customise hledger command arguments, so (depending on the graph) it could be as easy as tweaking –depth there

---

<div class="post-metadata">

### Author: ![joviwu](https://avatars.discourse-cdn.com/v4/letter/j/b5ac83/32.png) [@joviwu](https://forum.plaintextaccounting.org/u/joviwu)
#### Post date: [May 26, 2026, 6:58am UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696/10 "2026-05-26T06:58:39Z")

</div>

Dear author,  
My Expenses Treemap isn't showing up, but Historical Account Balances, Income & Expenses Flows, and All Cash Flows are working fine. Could you please help me figure out what's going wrong?

 ![螢幕擷取畫面 2026-05-26 145752](https://canada1.discourse-cdn.com/flex003/uploads/plaintextaccounting/original/1X/f17baf136ca8fdeb13ee727ac9d8b1bb6eb85d72.jpeg)

---

<div class="post-metadata">

### Author: ![adept](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/adept/32/36_2.png) [@adept](https://forum.plaintextaccounting.org/u/adept)
#### Post date: [May 26, 2026, 7:47pm UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696/11 "2026-05-26T19:47:37Z")

</div>

You can open this as a github issue at [Issues · adept/hledger-lit · GitHub](https://github.com/adept/hledger-lit/issues) - it would make it easier for me. But we can also try and continue here.

Are there any errors printed to the console when you press "Generate expenses treemap"?

Treemap data set (map from accounts to balances) is prepared by the exact same function that is used for sankey diagrams (cash flows), so we know that this part works. So I would suspect that the hledger command used to generate balances for the treemap is somehow wrong. Can you take it out of a sidebar and run it manually, or add `print(expanded_cmd)`after line 547 and run the printed command and see if produces anything, and then also add `print(expenses)` after line 548 and see if that prints out anything as well.

---

<div class="post-metadata">

### Author: ![joviwu](https://avatars.discourse-cdn.com/v4/letter/j/b5ac83/32.png) [@joviwu](https://forum.plaintextaccounting.org/u/joviwu)
#### Post date: [May 27, 2026, 7:37am UTC](https://forum.plaintextaccounting.org/t/hledger-lit-another-hledger-plotting-thingie/696/12 "2026-05-27T07:37:15Z")

</div>

I figured it out—my expenses are measured in kilograms, so they can’t be converted into currency.

2026-05-23 Preparing Mozart’s meal  
Assets:inventory:Mozart:Food:Beef:Knuckle -3.0 kg  
Expenses:Mozart:Food:Beef:Knuckle 3.0 kg  
Assets:inventory:Mozart:Food:Beef:Heart -0.3 kg  
Expenses:Mozart:Food:Beef:Heart 0.3 kg

After removing these transactions, the expense tree map works properly again.

 ![Expensetree](https://canada1.discourse-cdn.com/flex003/uploads/plaintextaccounting/original/1X/3a674eae101d36d1c2307bf2d192ca64dafd7b01.jpeg)
