I wrote this software to practice working with a SQL relational database from inside a Python program. My goal was to better understand how a program can create a database, store data, update existing records, delete records, and query saved information.
This program is a simple expense tracker. The user can add expenses with a name, category, amount, date, and notes. The program saves the expense information into a SQLite database instead of only storing it temporarily while the program is running. The user can also view all expenses, update an existing expense, delete an expense, and show a spending summary.
My purpose for writing this software was to become more comfortable with relational databases and SQL commands.
The relational database I used for this project is SQLite. SQLite is a lightweight database system that stores the database in a local file. In this project, the database file is created by the Python program when it runs.
The program uses one table called expenses. This table stores each expense as a separate record. Each record has an id as the primary key, which makes it possible to update or delete a specific expense.
The expenses table includes these columns:
id - an automatically generated primary key name - the name or description of the expense category - the category the expense belongs to amount - the cost of the expense date - the date of the expense notes - extra notes about the expense
I developed this project using Python and SQLite. I wrote and tested the program on Windows using PowerShell and JetBrains Rider.
The programming language used for this project was Python. I used the sqlite3 library to connect the Python program to the SQLite database. This library allowed me to create the database table, send SQL commands.
Tools used:
Python SQLite Python sqlite3 library JetBrains Rider Windows PowerShell Git and GitHub
- Add better input validation so the user cannot enter an invalid amount or date.
- Add a date range search so the user can view expenses between two dates.
- Improve the spending summary with more detailed totals by category.