Start 2025 on the right note, and use "PFP2025" at checkout to get a 10% discount!
Learn how to build a simple, privacy-aware, and developer-friendly workflow to keep your personal finances in check.
300+ (and counting!) happy readers
Explore what the other readers are saying.
Tracking Personal Finances using Python is a book that teaches software developers how to track their personal finances entirely using Python and a bunch of plain text files.
The Python ecosystem contains an excellent package called Beancount that provides the foundations for working with money. We'll take Beancount as the starting point to build an application that will act as the single point of contact for your complete financial history, and:
The final result will be a Git repository on your computer where you can view / edit everything related to your money.
We'll ensure data privacy by using only open source software and making sure that your financial data never leaves your computer.
There are a ton of applications on the market that you can use to manage your finances but most of them are either closed source or store your data on the cloud (or both).
We will do things differently. Your financial data is one of the most private data you own, and no one should have access to it, except you.
It goes one step beyond that. It's strictly aimed at software developers (and folks who want to pick up softare development). š
Have you ever wanted to run a SQL query on your bank transactions? By the end of this book you most definitely will.
We'll approach the subject from a developer perspective and learn about topics including plain text accounting, double entry bookkeeping, Beancount, maintaining your financial records in a secure git repository, and more.
All this, without ever leaving the comfort of your favorite $EDITOR
or the terminal.
We'll start with a light introduction including some background and motivation on why I wrote the book in the first place.
Next, we'll talk about topics including plain text accounting, double entry bookkeeping, and the surrounding concepts for you to quickly become productive.
This chapter introduces you to Beancount, how the Beancount ledger looks like, and the different data structure and tools that Beancount includes to work with money in Python.
This chapter will build upon the previous chapter by helping you set up your own Beancount-based workflow to track your personal finances, including writing a converter for your bank statements.
This chapter helps you establish a regression testing workflow for the Beancount importers you wrote in the previous chapter.
In the last chapter, we'll take a look at the visualization side of the story and introduce you to the different tools you can use to analyse your financial data.
Tracking Personal Finances using Python is a book that teaches software developers how to track their finances using Python. The reader is introduced to concepts such as plaintext accounting, double entry bookkeeping, Beancount, after which they are walked through importing their own financial transactions from their banks into a Beancount-backed ledger.
The book is distributed in the PDF and EPUB formats. Once you purchase the book, you will have access to both and can decide whichever you prefer more.
A programming background is required. If you can read and write Python code, that's excellent. If not, some experience with a similar high-level programming language (e.g., Ruby, Javascript, etc.) and willingness to read and write Python code will be helpful.
If you're on macOS or a Linux-based operating system, you should be good to go. If you're using Windows, you should be able to get good results using WSL (Windows Subsystem for Linux).
We'll be mainly working on the command line shell and writing code in a text editor. You can choose any text editor that you feel comfortable with, as long as it can be configured for writing Python code.
The book uses Beancount 2. At the time of this writing, Beancount 3 is a rather fresh release that breaks some existing functionality (e.g., Fava). Once a Fava update is released, I'll update the book to focuse on using Beancount 3.
Hey! My name is Siddhant, and I'm a software developer and entrepreneur located in Munich, Germany. š©šŖ
I've been writing Python code for more than a decade now. In my spare time, I maintain more than half a dozen open-source packages written in Python, which have collected a total of 1.5 million downloads from the PyPI.
A few years ago I discovered the world of plain text accounting and Beancount. Since starting to track my personal finances using Beancount, I can honestly say that this is the one technology that has had an outsized impact on my life. I love sharing what I've learned and this book is another attempt at doing that.
I hope you have as much fun reading it as I had writing it! And if you have any questions, DM/@ me on Mastodon and I'll get back to you as soon as I can!