Start 2025 on the right note, and use "PFP2025" at checkout to get a 10% discount!

Buy at discount

Tracking Personal Finances using Python šŸ

Learn how to build a simple, privacy-aware, and developer-friendly workflow to keep your personal finances in check.

5.0

300+ (and counting!) happy readers

Tracking Personal Finances using Python šŸ

Testimonials

Explore what the other readers are saying.

Extremely thorough and well-researched

"Tracking Personal Finances using Python is extremely thorough and and well-researched. Siddhant's love of plaintext accounting shows through in the writing. Iā€™m a regular beancount user, and his book still taught me new techniques for tracking my finances easily."

profile picture

I highly recommend it - super useful!

"A friend of mine told me about Siddhant's book while he was writing it. I was just getting into Beancount to help organize my finances, and the book was an invaluable guide. I highly recommend it - super useful!"

profile picture

The book has paid for itself many times over.

"I started using Beancount in Dec last year thanks to this book. I can now safely say that the book has paid for itself many times over. If you are interested in plain text accounting but don't know where to start, this is a great place to begin."

profile picture

0 to a working workflow in 1 day

"I really liked the content and was able to sift through it and go from 0 to a working workflow with 3 sources and 3 months of data in 1 day."

profile picture

The chapters on writing (AND TESTING!) custom providers are really helpful.

"I've actually already finished your book, and the chapters on writing (AND TESTING!) custom providers are really helpful, so I'll be able to write my simplefin importer that I want to make."

profile picture

I got a year's worth of financial transactions imported in a day thanks to the leg up this book gave me.

"This was the only resource I could find that actually walks you through how to do that and provides sample code. I've never written a python program before, but the concepts were straightforward and I got a year's worth of financial transactions imported in a day thanks to the leg up this book gave me."

profile picture
Tracking Personal Finances using Python šŸ

The Book

In this book, we'll work on building your personalized "multi-banking" application powered entirely using Python and a bunch of plain text files.

The Python ecosystem contains an excellent package called Beancount which provides the foundations for working with money. At its core, Beancount provides a collection of command line utilities to manage and perform different kinds of analysis on financial transactions stored in plain-text files.

We'll take Beancount as the starting point to build an application that will act as the single point of contact for your entire financial history, and:

  1. store every single piece of data from all your bank accounts (only on your machine)
  2. act as the the first point of contact if you want to look up anything related to your finances (questions like "How much did I make from that consulting work last month?" or "What did I spend on that vacation last year?")
  3. import new financial transactions from your bank accounts on a continuous basis
  4. use customized tools to interact with your financial ledger, analyze your past financial behavior, show your spending patterns, income sources, current liabilities, and more

The final result will be a Git repository on your computer where you can view / edit everything related to your money.

Get started

Data Privacy

You might be thinking: aren't there a ton of applications on the market which you can use to manage your finances with ease?

Yes, there are. But most of them are either closed-sourced or store your data on the cloud (or both).

We will do things differently. We will focus on putting something together using open-source technologies. We will make sure that your data never leaves your computer, and that you are in control at all times. Your financial data is one of the most private data you own. No one else should have access to it, except you.

Tracking Personal Finances using Python šŸ
Tracking Personal Finances using Python šŸ

Developer Friendly

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.

Table of contents

Chapter 1: Introduction

We'll start with a light introduction including some background and motivation on why I wrote the book in the first place.

Chapter 2: Plain Text Accounting

Next, we'll talk about topics including plain text accounting, double entry bookkeeping, and the surrounding concepts for you to quickly become productive.

Chapter 3: Beancount

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.

Chapter 4: Workflow

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.

Chapter 5: Testing

This chapter helps you establish a regression testing workflow for the Beancount importers you wrote in the previous chapter.

Chapter 6: Reporting

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.

Frequently asked questions

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.

Siddhant Goel

About the Author

Hey! My name is Siddhant, and I'm a software developer and entrepreneur located in Munich, Germany.

I've been writing Python code for slightly more than a decade now. In my free time, I maintain more than half a dozen open-source packages written in Python, which have been downloaded 500k+ times from PyPI.

If you have any questions, DM/@ me on Mastodon and I'll get back to you as soon as I can!

Get started