Table of contents

Overview

The Budget Planner project is software designed to keep track of expenses; this is done using a budget template which stores three types of user input. These inputs are expense categories, income categories and transactions. Below is an image which illustrates the basic layout the user will interact with.

In this image we can see each of the input groups without any inputs. To add content we can click on the options menu.

Here we can see options for adding a new expense category, job (income category), or transaction. Each option prompts a pop-up form.

Adding content to our example budget we can get something like the image below. Of course an actual budget could be far more sophisticated depending on how many categories the user wants.

Notice that the income and expense columns are automatically subtotaled and actual transactions are recorded side by side with their associated income or expense category. This results in a net income row for both expected and actual results.

Note that we can edit individual records if mistakes are made. To help reduce the likelihood of a mistake, however, validation measures have been implemented on the backend to reduce user error. This includes ensuring only numerical values are allowed in the outlay and inflow portion of the form. There is also a check to ensure the date given is valid.

Features

Apart from adding transactions and the categories they belong to, we can manipulate transactions and categories after they are added. For example if we right click on our transaction we get a context menu with some options. For example if we entered our merchant as Store A, but meant Store B we would click Edit Transaction... or we could remove the transaction entirely and start over.

At this point it is worth mentioning that a budget template in and of itself is limited. If, as I do, you want to record new observations each month, a single budget template is not enough. When creating a new budget we are allowed to choose either a template or a budget (or group of templates). Templates are designed for a single one time use expense report while budgets are designed to work in a sequential way. Notice the Previous and Next buttons. Currently Previous only allows a user to go back to a previous budget template if one already exists while the Next button will allow the user to create a new budget template if one does not currently exist. Clicking Next in our example we get an Add Next Budget form followed by a Add Budget form.

Notice that in Add Budget we have three options Blank, Previous, and Saved. In each case transactions will be reset for the new template. When Blank is chosen the income and expense categories will be removed. Selecting Previous will retain the previous categories. The Saved choice will work like Blank until the feature is properly set up. Below we can see what happens when we select Previous:

Notice that our group of budgets is referred to as Example Budget while the individual budget templates are referred to as Sample 1 and Sample 2. This completes our overview of the features. To see the future goals for the project skip to Goals.

Code

This software is designed using Python's Tkinter package. The code is organized using classes with the MVC (Model View Controller) software architectural pattern. The MVC pattern allows the program to split tasks between different classes which we store in separate files. Essentially the view is designed to be seen by the user so that the user can interact with the controller, the controller can then update the model and the model updates are reflected in the view.

One example from my code is the models.py file which has a class named ProjectModel. To save and load a budget we utilize two methods save_as_pickle and load_pickle whose code is below:

def save_as_pickle(self, fp):
    """Save current budget or template as named pickle binary file."""
    with open(fp, 'wb') as f:
        pickle.dump(self.template_data, f)

@staticmethod
def load_pickle(fp):
    """Load budget or template from a given directory."""
    with open(fp, 'rb') as f:
        try:
            result = pickle.load(f)
        except pickle.UnpicklingError:
            result = 'loading_error'
    return result

These methods are called by the user by interacting with the controller. This file was was part of the model in the MVC pattern. This program also has files such as application.py, views.py, menus.py, and widgets.py.

Goals

This is one of my favorite programs due to its ease of use and practical applications. I tend to use this program every other day to record various expenditures and the occasional paycheck. The current version of the software needs significant improvements. Many desired features are not complete and significant improvements can still be made. Let's break these improvements into a few basic categories roughly corresponding to the MVC pattern: data integrity (the Model), visual appeal (the View), and user interaction (the Controller).

With regards to data integrity:

  • SQL database integration
  • Export to .csv files
  • Print to PDF

With regards to visual appeal:

  • Warning color when budgeted expense is exceeded
  • Ability to change table colors
  • Improve view responsiveness

With regards to user interaction:

  • Complete menu bar
  • Resizable tables and form fields
  • Ability to differentiate between salaried and hourly jobs
  • Ability to rearrange templates in a budget group
  • Ability to reorder transactions and categories
Budget Planner options menu. New expense category form. New job category form. New transaction form. Budget Planner sample budget. Budget Planner blank budget. Transaction right click context menu. Next budget form. Add budget form. Sample 2 budget template.