A tiny Python 3.9+ library inspired by Mr. Money Mustache to summarize and plot personal finance data given in a CSV file of transactions. Uses Pandas and Plotly to do most of the work.
Smacks of plain text accounting but is limited to single-entry transactions and focuses only on income and expenses. For full-featured double-entry bookkeeping in Python, use a different library, such as beancount.
Create a Python 3.9+ virtual environment and run poetry add mustaching
.
Play with the Jupyter notebook at notebooks/examples.ipynb
.
You can even do so online by clicking the Binder badge above.
Using Binder you can also upload your own transaction data into the notebook, but consider first Binder's warning about private data.
Your CSV of transactions should contain at least the following columns
date
: string; something consistent and recognizable by Pandas, e.g 2016-11-26amount
: float; amount of transaction; positive or negative, indicating an income or expense, respectivelydescription
(optional): string; description of transaction, e.g. 'dandelion and burdock tea'category
(optional): string; categorization of description, e.g. 'healthcare'comment
(optional): string; comment on transaction, e.g. 'a gram of prevention is worth 16 grams of cure'
The business logic can be found in mustaching/main.py
At araichev.github.io/mustaching_docs/.
- Development status: Alpha
- This project uses semantic versioning
- Alex Raichev, 2016-11
- Updated dependencies.
- Added Github action for testing.
- Updated dependencies, removing version caps.
- In
summarize()
, dropped unused categories after slicing to the given date range.
- Upgraded to Python 3.9.
- Major refactor of
summarize()
andplot()
functions. - Replaced Python Highcharts with Plotly.
- Used Pandera for data validation.
- Tweaked chart colors.
- Upgraded to Python 3.8.
- Switched to Poetry.
- Published docs using publish-sphinx-docs.
- Published on PyPi.
- Dropped unused categories in
summarize()
.
- Changed the columns output by the function
summarize
- Renamed the function
build_sample_transactions
tocreate_transactions
- Added more columns to the output of the function
summarize
- Switched from using 'credit' and 'debit' to 'income' and 'expense', because i find that clearer
- In function
summarize
, changed weekly and daily averages calculations to use credit - debit. Also changed default sort order of DataFrame output.
- Changed function
summarize
to split savings rate by category and to include weekly and daily averages when no frequency is given - Fixed an edge-case division-by-zero bug in function
summarize
- Fixed a bug in function
insert_repeating
that lost the categorical dtype - Added optional slicing by date in function
summarize
- Fixed the bug where
setup.py
could not find the license file
- Removed
budget_and_freq
option, because i don't need that extra complexity - Calculated spending rate
- Added function
insert_repeating
to avoid having to record repeating transactions in my personal spendings - Prepared for PyPi
- Fixed README and
ipynb/examples.ipynb
- Lowercased category names and values when reading transactions
- Added percentages to bar chart stacks when splitting by categories
- Sorted categories from highest to lowest values in bar chart stacks
- Changed name to 'mustaching' and restructured directories
- Wrote automated tests
- Made function
read_ransactions
infer column names a little - Made funnction
summarize
always create'period_budget'
column and fill it with NaNs if no budget given
- Changed summary columns to
'credit'
,'expense'
, and'balance'
- Plotted balance as a cumulative sum line series
Fixed date labels and off-by-1-day error in time grouping
First release