My personal accounting and life management software

Coding · December 20, 2012

1+1=3 image
Photo credit: George Becker

The ability to manage money is among the most powerful skills for improving your quality of life that is solely dependent on your behavior. However, understanding your past behavior without detailed records is essentially impossible. To this end, accounting is properly defined as a record of the transactions that have occurred in the past (as opposed to budgeting, which is a plan for transactions to occur in the future). What we are discussing here is an accounting script I wrote in both Python and JavaScript. The Python is on GitLab. The JavaScript is on my blog where the graphs are powered by D3.

This project is sentimental to me for a couple reasons. It was my first project in Python. It was my first project using all sorts of basic programming tropes like recursion and classes. I have rewritten these scripts six or seven times in the last 15 years. The early versions were rough as all early versions are, especially when part of the challenge is learning new complex tools (in this case, basic programming). It is also the software that runs my life to this day. The software has evolved greatly; the conceptual architecture (read a CSV with 5 columns and write a report) is unchanged since the first version in 2012. I have a record in this CSV file of every financial transaction I have partaken in since January 1st, 2013. That CSV file is 22,000 lines long as of September, 2026, with 21,500 transactions (there are a few hundred lines of comments as well).

The basic idea

Longer explanation of accounting is on my blog.

Double-entry accounting is the term for designing an accounting system where all transactions are recorded once and apply to two different accounts. For example, in the CSV text below, $58.13 was spent at Kroger and this money moved from the amex account (a credit card), to the grocery account (a spending category). Some accounts store wealth or debts (bank accounts, credit cards, loan accounts for autos and houses); some are spending categories (healthcare, transportation, housing, etc); some are income (day job, side jobs, rent from a rental property, etc); and some are just containers which store other accounts as sub accounts (net worth, all spending categories, all income, etc).

My Python script takes a 5 column CSV shown below and generates reports.

date,description,value,from,to
2026-01-05,Kroger,58.13,amex,groc

From this CSV, my scripts produce a number of important outputs:

simulated data for personal accounting
Simulated financial data displayed by my accounting software.

Simulated financial data below shows an example report produced by my account software. Like the graph above, I see a similar report with real data on a daily to weekly basis to help me make decisions.

Balance (29,0) 
     Expenses (23,0) 
          Housing (6) 
          2020-02-01 Electric bill ........................     73.23
          2020-02-01 Rent on apartment ....................   1050.00
          2020-02-10 Internet ISP .........................     63.19
          2020-02-10 Phone bill ...........................     85.33
          2020-02-10 Renters insurance ....................     16.62
          2020-02-10 Water bill ...........................     12.49
                     Total ................................   1300.86
          Healthcare
          2020-02-13 Health insurance premiums ............    164.33
                     Total ................................    164.33
          Auto/Transportation (6) 
          2020-02-03 Valero ...............................     19.62
          2020-02-11 Chevron gas station ..................     15.57
          2020-02-15 Car loan interest ....................     63.19
          2020-02-17 Jiffy lube - oil change ..............     49.22
          2020-02-19 Valero ...............................     19.26
          2020-02-27 Valero ...............................     16.42
                     Total ................................    183.28
          Groceries (4) 
          2020-02-02 Kroger ...............................    203.60
          2020-02-10 Kroger ...............................    185.40
          2020-02-18 Kroger ...............................    174.87
          2020-02-26 Kroger ...............................    133.56
                     Total ................................    697.43
          Misc (6,4) 
          2020-02-11 video game ...........................     65.29
          2020-02-15 Netflix ..............................      9.73
          2020-02-15 Spotify ..............................     10.81
               Food in restaurant
               2020-02-03 Drinks with coworkers ................     15.13
               2020-02-17 Drinks with coworkers ................     15.07
                          Total ................................     30.20
                     Total ................................    165.98
                Total .................................  2511.88
     Income (6,0) 
          City Zoo
          2020-02-14 City Zoo - payroll ...................  -1731.32
          2020-02-28 City Zoo - payroll ...................  -1731.32
                     Total ................................  -3462.64
          Miscellaneous (4) 
          2020-02-02 Home Depot - supplies for ERICDECK ...    598.83
          2020-02-03 Home Depot - saw blade for ERICDECK...     49.29
          2020-02-03 Home Depot - supplies for ERICDECK ...    399.74
          2020-02-06 ERICDECK - paid by check .............  -2082.84
                     Total ................................  -1034.98
                Total ..................................  -4497.62
           Total ................................... -1985.74

Add-ons that make it “life management” software

Every time I fill up my car, I record the mileage and the gallons of gas. Every time I change the oil, I record the mileage of the next change. My main report script looks for my car's current mileage (based on the last gas record) and the mileage of the next oil change (from the last oil change record) and prints out how many miles I have left before I need to change my oil.

date,description,value,from,to
2026-01-07,08Civic - Gas - 8.209 - 320.5 - 145078 ,30.23,amex,trans
2026-01-07,08Civic - Oil - Jiffylube - next change 148100,65.43,amex,trans

When I record my utility bills, I record the amount of the thing I purchased.

date,description,value,from,to
2026-01-20,Water bill - 4500 gal ,29.87,amex,housing
2026-01-20,Electric bill - 2836 kwh,327.98,amex,housing
2026-01-20,Gas bill - 13 CCF,45.67,amex,housing

These records allow me to judge if something is wrong with my usage or if prices are rising. In the southern US where I live, AC is 50% of the electric bill. If something malfunctions in your air conditioner, it can cause anything from a mild increase to a doubling of power usage. By the same token, recording water usage clearly shows whether prices are increasing or I have a leak.