Skip to content

The objective of this project is to demonstrate understanding in Object-Oriented Programming (OOP) by developing an expense tracker application using Python.

License

Notifications You must be signed in to change notification settings

victorcezeh/expense-tracker-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Object-Oriented programming (OOP) Project - Expense Tracker

Object-Oriented Programming!

The goal of this project is to assess my understanding of object-oriented programming (OOP) concepts in Python. I am tasked with implementing two classes, Expense and ExpenseDatabase to model and manage financial expenses. This project tested my proficiency in defining classes, utilizing class attributes and methods as well as handling time-related functionalities.

Table of Contents

Getting Started

The Expense Tracker is a Python program that manages individual financial expenses. It consists of two classes: Expense and ExpenseDataBase.

  • Expense represents an individual financial expense with attributes such as ID, title, amount, creation time, and update time. It provides methods that allows for updating expense attributes. It also provides a to_dict method that returns a dictionary representation of the expense.
  • ExpenseDataBase manages a collection of Expense objects. It provides methods to add expense, remove expense, and retrieve expenses such as getting expense by ID and Titles. It provides a to_dict method that returns a list of dictionaries representing expenses.

Classes

Expense

Attributes

id: Unique identifier generated as a UUID string.

title: String representing the title of the expense.

amount: Float representing the amount of the expense.

created_at: Timestamp indicating when the expense was created (UTC).

updated_at: Timestamp indicating the last time the expense was updated (UTC).

Methods

update_expense(title, amount): Updates the expense details.

to_dict(): Returns a dictionary representation of the expense.

ExpenseDataBase

Attributes

expenses: List storing Expense instances.

Methods

add_expense(expense): Adds an expense to the collection.

remove_expense(expense_id): Removes an expense from the collection.

get_expense_by_id(expense_id): Retrieves an expense by ID.

get_expense_by_title(expense_title): Retrieves expenses by title.

to_dict(): Returns a list of dictionaries representing expenses.

Tools Used

Clone Repo

Copy link below and paste on yout Git to clone the repository.

git clone https://github.com/victorcezeh/Object_Oriented_Programming_Project.git
cd Object_Oriented_Programming_Project

Usage

Run the Expense Tracker with the code below.

python main.py

Project Structure

Object_Oriented_Programming.py: This file contains the Expense and ExpenseDataBase Class Implementations code.

README.md: Project documentation.

main.py: The main script to test run the Expense Tracker.

Acknowledgement

A huge thank you to Altschool Africa for equipping me with the necessary skillset to take on this project.

Contributing

If you'd like to contribute to the project, kindly contact ezeh_victor@yahoo.com

About

The objective of this project is to demonstrate understanding in Object-Oriented Programming (OOP) by developing an expense tracker application using Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages