Show HN: Bagels – TUI expense tracker (github.com)
Hi! I'm Jax and I've been building this cool little terminal app for myself to track my expenses and budgets!
Other than challenging myself to learn Python, I built this mainly around the habit of budget tracking at the end of the day. (I tried tracking on-the-go, but the balance was always out of sync.) All data is stored in a single sqlite file, so you can export and process them all you want!
The app is built using the textual API for Python! Awesome framework which feels like I'm doing webdev haha.
You can check out some screenshots on gh: https://github.com/EnhancedJax/Bagels
Thanks!
89 comments
[ 3.0 ms ] story [ 170 ms ] threadShout-out to Charmbracelet's stuff such as Glow (https://github.com/charmbracelet/glow) and Gum (https://github.com/charmbracelet/gum) for rendering markdown nicely in the terminal and for using TUI in your shell scripts
https://github.com/Textualize/textual-web
https://github.com/EnhancedJax/Bagels/blob/7b4bfd051f6beff8f...
But the actual character is: ╯
https://www.unicode.org/charts/nameslist/n_2500.html
Are there any frameworks or examples of this being done?
I’ve not looked into this is years but I once had this idea that in browser terminal and I remember discovering there exists javascript xterm implementation.
For me though I was thinking the setup needs custom MFA security since public browsers or devices can be compromised. Haven’t researched yet how to somehow add that to the access.
If it worked how I’d imagine you can just walk up to any computer with a modern browser, go to your self-hosted IP, it sends you access code to phone, or uses authenticator or rsa token, something, and you get your terminal access.
It wouldn't be too difficult to extend this to support webauthn/passkeys via a little bit of magic.
Actually... that sounds like a pretty interesting project.
Question: Is there a good equivalent of the Dewey Decimal system for household and/or business expenses? I like your two level breakdown in default_categories.yaml and the must/need/want system and I’m wondering what prior art you used to put that together?
I see about 800 payees for my own transactions over the past two years and while the big ticket items are easy enough to spot — my favourite grocery store, my landlord, etc. — having a taxonomy that can encompass the long tail of spending would give me confidence that I have 100% understanding of my finances.
Edit: Here’s one from some UN statisticians. Turn to page 40 of the PDF (p27 in print) for the basic structure overview:
https://unstats.un.org/unsd/classifications/Econ/Download/In...
The overview felt quite ergonomic but rebalancing the overview to maintain constant branching might be useful. Section 625 on “retail services” is very large.
I primarily built Bagels starting from my use case, so maybe some of the modelling might not suit expenses of large quantities. I haven't got to the point in life where I have to pay taxes and bills yet haha
For example from that PDF, bagels would have the classification "23490 Bread and other bakers' wares". That's under "23 Grain mill products, starches and starch products; other food products" -> "234 Bakery products".
To be able to see how often one buys grain products, and then bread products, is either funny, or an unnecessary amount of detail.
I've thought of scanning all my grocery store receipts, for example to calculate how many liters of Coca-Cola I've bought in a time period...
uv run --python 3.13 --no-project --with bagels bagels
However, there is some value in entering your expenses manually... either you won't; or you'll spend less so you have less to enter.
But, man, Textual is such a chore to write and docs are crap. Is there HTML based TUI toolkit?
I know there’s https://github.com/vadimdemedes/ink, anything else besides it?
Maybe give it a second try haha
[0] https://gocardless.com/guides/posts/european-payments/
Looks very slick though, congrats on getting it to this level of polish!
Great job!
If anyone is looking for tools or TUIs out there in Python or other languages we host a collection of them here [0] [1]
[0] https://terminaltrove.com/
[1] https://terminaltrove.com/language/python/
We get hundreds of submissions a day and we try out most of the tools that are submitted, but we are more receptive to screenshots, ease of install / multiple packages (if any), and if it is (ideally) cross platform.
You should see Bagels in the trove soon!
It's only for dev-specifics dependencies that they are using the uv-specifics section.
You can try uv in 2 min and see if you like it or not.
The author probably really likes uv, thus the biased instructions.
I also think uv is great, but I wouldn't mention it in the user facing installation instructions. People are used to pip/pipx, thus asking them to install yet another tool might drive potential users away.
The usual pip or pipx command should work fine. It's listed on PyPI: https://pypi.org/project/Bagels
I would only mention uv in the Development Setup section (https://github.com/EnhancedJax/Bagels?tab=readme-ov-file#dev...)
For instance, running `uvx --python 3.13 Bagels` made a temporary environment and installed all dependencies in 1.01s on my computer, and it took less than 10 seconds for the program to start after creating a database etc. Next start takes less than 2 seconds since it's cached. If I decide I want to keep using it, I can install it using the uv tool command, if not I just do nothing.
https://docs.astral.sh/uv/guides/tools/
I ask because funny enough over the weekend I spent 4 hours writing a terminal based expense tracker with a sole focus on making it easy to see income vs expenses vs business expenses totals to make it easier for me to file quarterly and yearly taxes. It's not a TUI but it lets me put items into a category and it tallies up the amounts with counts.
It's simple input / output with CSV files that you can edit with whatever editor you want and that's the main reason I wrote it. I've been using GnuCash for almost 10 years and it's kind of inefficient to input data quickly.
It's nice to see your project on the other side of the spectrum (super polished, TUI, etc.). What's it like to quickly add in items or generate income / expense / business expense reports? Ideally I'd like to be able to open my code editor of choice and do whatever operations I need to quickly insert multiple items into multiple categories.
The TUI is the frontend for the schema. You can do all CRUD with the UI, and I designed it to be able to add multiple records quickly, with input modes and templates!