This project implements an expense database to manage financial expenses using Python's object-oriented programming (OOP) concepts.
It consists of two main classes: Expense
and ExpenseDatabase
, allowing users to model and manage financial expenses efficiently.
expense.py
: Contains the Expense and ExpenseDatabase classes.expense_db.py
: Demonstrates the usage of the implemented classes to manage expenses.
-
Copy this Repository's URL: Click on the green "Code" button and copy the URL provided (https://github.com/damidfkm/ExpenseDB). You can click the clipboard icon next to the URL to copy it.
-
Open Terminal or Command Prompt: Open a terminal or command prompt on your computer.
-
Navigate to the Directory Where You Want to Clone the Repository: Use the cd command to navigate to the directory where you want to clone the repository. For example:
cd path/to/desired/directory
- Clone the Repository: Use the git clone command followed by the URL you copied earlier.
git clone https://github.com/damidfkm/ExpenseDB.git
-
Confirm the Cloning Process: Wait for the cloning process to complete. Once it's finished, you'll have a local copy of the repository on your computer in the directory you specified.
-
Remember, you'll need Git installed on your computer to use the
git clone
command.
However, if you're looking for alternatives to clone or download a repository without using the command line or Git, you can use the GitHub website interface:
-
Using GitHub's "Download ZIP" Option:
-
Click on the green "Code" button.
-
Select "Download ZIP."
This will download a compressed file (ZIP) of this repository to your computer. Extract the contents to access the files.
To run the code:
- Ensure you have Python installed (Python 3.7 or higher).
- Navigate to the project directory in your terminal.
- Run the following command:
python3 expense_db.py
This will execute the demonstration code in expense_db.py
, showcasing various functionalities of the expense database.
Expense Class:
- Represents an individual expense.
- Use the
update
method to modify an expense's title or amount.
ExpenseDatabase Class:
- Manages a collection of expenses.
- Use methods like
add_expense
,remove_expense
,get_expense_by_id
, andget_expense_by_title
to handle expenses in the database.