Tracking Personal Finances Using Python (PragProg)

Learn how to build a privacy-aware and developer-friendly workflow using Python to keep track of your personal finances.

d-sgperfin-500

Siddhant Goel @siddhantgoel

In this book, you’ll build your personalized multi-banking application powered entirely by Python. The Python ecosystem contains an excellent package called Beancount that provides data structures and command line utilities for working with money. This book will show you how to use Beancount to maintain double-entry accounting records of all your financial transactions in a plain text file, and use the CLI/web tools Beancount provides to work with this ledger. The final result will be a Git repository on your computer where you can view & edit everything related to your money.

Beancount is an excellent piece of software that provides a command line implementation of the double-entry accounting system. At its core, it gives you data structures for working with money, a language specification for defining financial transactions in a plain-text format, and CLI scripts that tie everything together.

A Beancount-driven workflow involves maintaining a ledger of all your financial transactions in a plain-text file and using CLI/GUi tools to interact with this ledger, analyze your past financial behavior, show your spending patterns, and much more. This book walks the reader through building such a workflow from scratch.

We start with introducing the reader to plain-text accounting and double-entry bookkeeping. In the next chapter, we talk about Beancount, the different tools that it provides its users, and what a Beancount-driven workflow looks like. Next, we help the reader build such a workflow for themselves. Using a lot of sample code, we help the reader set up a “finances” git repository on their disk and write code to convert transactions from their bank(s) into the Beancount file format. This chapter is quite heavy on code, which is why we follow up with writing tests for this code using pytest. The final chapter describes the CLI and GUI tools that the Beancount ecosystem gives the reader. All these tools help the reader generate various reports for their financial life, both on the console (using CLI tools) and in a graphical format (using a web application).

This book is intended only as an informative guide for those wishing to learn more about Python programming and personal financial transactions. In no way is this book intended to replace, countermand, or conflict with best bookkeeping practices, accounting standards, or financial regulations in your region or anywhere else.

This work was written and produced entirely by the author. We are proud to be distributing it.


Siddhant Goel is a senior software engineer and open-source maintainer based in Munich, Germany. He has been writing Python code for more than a decade now, and is the primary maintainer of multiple open-source modules written in Python published on the PyPI.


Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

3 Likes

Corresponding tweet for this thread:

Share link for this tweet.

2 Likes