Giter Site home page Giter Site logo

mustaching's Introduction

Mustaching

https://img.shields.io/badge/launch-binder-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJXWAAAAbXRSTlMAEBAQHx8gICAuLjAwMDw9PUBAQEpQUFBXV1hgYGBkcHBwcXl8gICAgoiIkJCQlJicnJ2goKCmqK+wsLC4usDAwMjP0NDQ1NbW3Nzg4ODi5+3v8PDw8/T09PX29vb39/f5+fr7+/z8/Pz9/v7+zczCxgAABC5JREFUeAHN1ul3k0UUBvCb1CTVpmpaitAGSLSpSuKCLWpbTKNJFGlcSMAFF63iUmRccNG6gLbuxkXU66JAUef/9LSpmXnyLr3T5AO/rzl5zj137p136BISy44fKJXuGN/d19PUfYeO67Znqtf2KH33Id1psXoFdW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vgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC

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.

chart

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.

Installation

Create a Python 3.9+ virtual environment and run poetry add mustaching.

Usage

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-26
  • amount: float; amount of transaction; positive or negative, indicating an income or expense, respectively
  • description (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

Documentation

At araichev.github.io/mustaching_docs/.

Notes

  • Development status: Alpha
  • This project uses semantic versioning

Authors

  • Alex Raichev, 2016-11

Changes

4.0.3, 2023-11-04

  • Updated dependencies.
  • Added Github action for testing.

4.0.2, 2022-02-27

  • Updated dependencies, removing version caps.

4.0.1, 2021-10-21

  • In summarize(), dropped unused categories after slicing to the given date range.

4.0.0, 2021-10-20

  • Upgraded to Python 3.9.
  • Major refactor of summarize() and plot() functions.
  • Replaced Python Highcharts with Plotly.

3.1.3, 2021-01-23

  • Used Pandera for data validation.
  • Tweaked chart colors.

3.1.2, 2020-09-06

  • Upgraded to Python 3.8.

3.1.1, 2019-04-03

  • Switched to Poetry.
  • Published docs using publish-sphinx-docs.
  • Published on PyPi.
  • Dropped unused categories in summarize().

3.1.0, 2018-03-31

  • Changed the columns output by the function summarize

3.0.0, 2018-01-01

  • Renamed the function build_sample_transactions to create_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

2.2.1, 2017-10-14

  • In function summarize, changed weekly and daily averages calculations to use credit - debit. Also changed default sort order of DataFrame output.

2.2.0, 2017-09-25

  • 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

2.1.0, 2017-05-07

  • Fixed a bug in function insert_repeating that lost the categorical dtype
  • Added optional slicing by date in function summarize

2.0.1, 2017-04-26

  • Fixed the bug where setup.py could not find the license file

2.0.0, 2017-04-25

  • 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

1.2.1, 2017-03-01

  • Fixed README and ipynb/examples.ipynb

1.2.0, 2017-03-01

  • 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

1.1.0, 2016-12-13

  • 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

1.0.0, 2016-12-10

  • Changed summary columns to 'credit', 'expense', and 'balance'
  • Plotted balance as a cumulative sum line series

0.1.1, 2016-11-21

Fixed date labels and off-by-1-day error in time grouping

0.1.0, 2016-11-18

First release

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.