Now updated for Beancount 3!

Tracking Personal Finances using Python šŸ

Learn double-entry bookkeeping with Python. Build a plaintext accounting system using Beancount in this comprehensive book for software developers.

300+ happy readers

Tracking Personal Finances using Python šŸ

Testimonials

Extremely thorough and well-researched

"Tracking Personal Finances using Python is extremely thorough 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."

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!"

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."

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."

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."

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."

What is Tracking Personal Finances using Python?

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:

  1. store every single piece of data from all your bank accounts (strictly on your machine)
  2. act as the the first point of contact to look up anything related to your finances
  3. import new financial transactions from your bank accounts on a continuous basis, and
  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 track everything related to your finances.

Get started

How do you ensure data privacy?

We'll ensure data privacy by using only open source software and making sure that your financial data never leaves your computer.

Most finance apps are either closed-source or store data in the cloud (or both). We do things differently: your financial data stays with you.

Get started

Is the workflow developer-friendly?

It's only for software developers and those looking to get into software 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.

Get started

Table of Contents

  • 01
    Introduction
    We'll start with a light introduction including some background and motivation on why I wrote the book in the first place.
  • 02
    Plain Text Accounting
    We'll cover plain text accounting, double entry bookkeeping, and related concepts to get you productive quickly.
  • 03
    Beancount
    We'll introduce Beancount, explore its ledger format, and learn the data structures and tools for working with money in Python.
  • 04
    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.
  • 05
    Testing
    This chapter helps you establish a regression testing workflow for the Beancount importers you wrote in the previous chapter.
  • 06
    Reporting
    In the last chapter, we'll explore visualization tools and techniques for analyzing your financial data.

Frequently Asked Questions

What is Tracking Personal Finances using Python?
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.
What formats is the book distributed in?
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.
Do I need to have a programming and/or Python background?
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.
What operating system do I need to have?
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).
Are there any software requirements I need to be aware of?
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.
Is the book using Beancount 2 or Beancount 3?
As of June 2025, the book has been updated to reference Beancount 3!

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 more than a decade now. In my spare time, I maintain several open-source packages written in Python, which have totaled more than 2 million downloads on 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 enjoy it! If you have questions, feel free to reach out on Bluesky.

Get started