Skip to content

Commit 147e4fc

Browse files
use sun-valley theme from sv_ttk and imrpove whole project
1 parent 269c835 commit 147e4fc

18 files changed

+446
-208
lines changed

README.md

+210
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# Expense Tracker
2+
3+
![Python](https://img.shields.io/badge/Python-3.x-blue.svg)
4+
![Tkinter](https://img.shields.io/badge/Tkinter-GUI-yellow.svg)
5+
![SQLite](https://img.shields.io/badge/SQLite-3-lightgrey.svg)
6+
![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
7+
8+
## Overview
9+
10+
The **Expense Tracker** is a graphical application built with Python and Tkinter, designed to help users manage their expenses efficiently. It utilizes SQLite for data storage and offers an intuitive interface for adding, categorizing, and analyzing expenses. Whether for personal use or small business needs, this tool aims to simplify expense tracking and financial management.
11+
12+
## Features
13+
14+
- 📊 **Expense Management:**
15+
- Add, edit, and delete expenses with details such as amount, date, category, and notes.
16+
- Categorize expenses for better organization and analysis.
17+
18+
- 🗃️ **Data Storage:**
19+
- Uses SQLite database to store expense records securely locally.
20+
- Provides robust data management capabilities through SQL queries.
21+
22+
- 📅 **Date Filtering:**
23+
- Filter expenses by specific dates to view transactions within a specified timeframe.
24+
25+
- 📈 **Expense Analytics:**
26+
- Generate summaries and visual representations (charts/graphs) of expenses over time or by category.
27+
- Gain insights into spending patterns for informed financial decisions.
28+
29+
- 🎨 **Customizable Interface:**
30+
- User-friendly GUI built with Tkinter, offering a responsive and customizable experience.
31+
32+
## Future Development
33+
34+
🚀 **Under Development**
35+
36+
The Expense Tracker is continuously evolving with planned features to enhance functionality and user experience:
37+
38+
- **Expense Report Generation:** Export detailed expense reports in PDF or CSV formats.
39+
- **Budget Planning:** Set budgets and receive alerts when nearing or exceeding limits.
40+
- **Cloud Integration:** Synchronize data across devices and cloud storage for accessibility.
41+
- **Data Insights:** Incorporate machine learning for predictive analytics and spending behavior analysis.
42+
- **Multi-user Support:** Enable multiple user profiles with secure login and personalized settings.
43+
- **Expense Reminders:** Schedule reminders for upcoming bills or recurring expenses.
44+
- **Localization:** Support for multiple languages and currency formats for global usability.
45+
46+
Stay updated with our roadmap and contribute to shaping the future of Expense Tracker by opening issues or submitting pull requests. Your feedback and ideas are crucial for improving the tool!
47+
48+
## Getting Started
49+
50+
### Prerequisites
51+
52+
- 🐍 Python 3.x installed
53+
- 🖼️ Tkinter library (usually included with Python installations)
54+
- 🗄️ SQLite3
55+
56+
### Installation
57+
58+
1. **Clone the repository:**
59+
60+
```
61+
git clone https://github.com/yourusername/expense-tracker.git
62+
cd python-env-tool
63+
```
64+
65+
2. **Install dependencies:**
66+
67+
```
68+
pip install -r requirements.txt
69+
```
70+
71+
3. **Setup the SQLite database:**
72+
73+
```
74+
python setup_db.py
75+
```
76+
77+
### Usage
78+
79+
1. **Run the application:**
80+
81+
```
82+
python gui.py
83+
```
84+
85+
86+
87+
. **Explore functionalities:**
88+
89+
- 📅 **Filter by Date:** Use date selectors to view expenses within a specific period.
90+
- 📊 **View Reports:** Analyze expenses with graphical representations.
91+
- 📝 **Add/Edit Expenses:** Input new expenses or modify existing ones easily.
92+
93+
## Sequence Diagram
94+
95+
::: mermaid
96+
sequenceDiagram
97+
participant User
98+
participant ExpenseTrackerView
99+
participant ExpenseTrackerController
100+
participant ExpenseModel
101+
participant Preferences
102+
103+
User->>ExpenseTrackerView: Opens Expense Tracker
104+
activate ExpenseTrackerView
105+
106+
ExpenseTrackerView->>ExpenseTrackerController: Request categories
107+
activate ExpenseTrackerController
108+
ExpenseTrackerController-->>ExpenseTrackerView: Categories
109+
deactivate ExpenseTrackerController
110+
111+
User->>ExpenseTrackerView: Adds new expense
112+
ExpenseTrackerView->>ExpenseTrackerController: Validate and save expense details
113+
activate ExpenseTrackerController
114+
ExpenseTrackerController->>ExpenseModel: add_expense(amount, category, date, description)
115+
activate ExpenseModel
116+
ExpenseModel-->>ExpenseTrackerController: Expense saved confirmation
117+
deactivate ExpenseModel
118+
deactivate ExpenseTrackerController
119+
120+
User->>ExpenseTrackerView: Filters expenses by category and date
121+
ExpenseTrackerView->>ExpenseTrackerController: Request filtered expenses
122+
activate ExpenseTrackerController
123+
ExpenseTrackerController->>ExpenseModel: get_expenses()
124+
activate ExpenseModel
125+
ExpenseModel-->>ExpenseTrackerController: Filtered expenses
126+
deactivate ExpenseModel
127+
deactivate ExpenseTrackerController
128+
129+
User->>ExpenseTrackerView: Requests expense reports
130+
ExpenseTrackerView->>ExpenseTrackerController: Generate report
131+
activate ExpenseTrackerController
132+
ExpenseTrackerController->>ExpenseModel: get_expenses()
133+
activate ExpenseModel
134+
ExpenseModel-->>ExpenseTrackerController: Report data
135+
deactivate ExpenseModel
136+
deactivate ExpenseTrackerController
137+
138+
User->>ExpenseTrackerView: Manages categories (add/remove)
139+
ExpenseTrackerView->>Preferences: Opens Preferences
140+
activate Preferences
141+
Preferences->>ExpenseModel: load_categories_from_db()
142+
activate ExpenseModel
143+
ExpenseModel-->>Preferences: Categories
144+
deactivate ExpenseModel
145+
146+
Preferences->>ExpenseModel: add_category(category)
147+
activate ExpenseModel
148+
ExpenseModel-->>Preferences: Category added confirmation
149+
deactivate ExpenseModel
150+
151+
Preferences->>ExpenseModel: remove_category(category)
152+
activate ExpenseModel
153+
ExpenseModel-->>Preferences: Category removed confirmation
154+
deactivate ExpenseModel
155+
156+
Preferences-->>ExpenseTrackerView: Update categories UI
157+
deactivate Preferences
158+
159+
User->>ExpenseTrackerView: Closes Expense Tracker
160+
ExpenseTrackerView->>ExpenseTrackerController: Close connection
161+
activate ExpenseTrackerController
162+
ExpenseTrackerController->>ExpenseModel: close_connection()
163+
activate ExpenseModel
164+
ExpenseModel-->>ExpenseTrackerController: Connection closed
165+
deactivate ExpenseModel
166+
deactivate ExpenseTrackerController
167+
168+
ExpenseTrackerView-->>User: Expense Tracker closed
169+
deactivate ExpenseTrackerView
170+
:::
171+
172+
## Entity-Relationship Diagram
173+
174+
::: mermaid
175+
erDiagram
176+
EXPENSE {
177+
id INT PK
178+
amount FLOAT
179+
category VARCHAR
180+
date DATE
181+
description TEXT
182+
}
183+
:::
184+
185+
186+
## Visualizations
187+
188+
### Expense Distribution by Category
189+
190+
![Expense Distribution](data/Figure_1.png)
191+
192+
### Monthly Expenses
193+
194+
![Monthly Expenses](data/Figure_2.png)
195+
196+
## Full Expense Report
197+
198+
For a detailed expense report, view the [PDF report](data/pdf.pdf).
199+
200+
201+
![Expense Tracker List](https://github.com/AbdullahBakir97/Py-Desktop-Expense_Tracker/assets/127149804/aa142657-cdbd-4060-8439-74a032fa2ad5)
202+
203+
204+
## Contributing
205+
206+
Contributions are welcome! Please feel free to open issues or submit pull requests for any improvements or additional features you'd like to see in the Expense Tracker.
207+
208+
## License
209+
210+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

data/Figure_1.png

53.4 KB
Loading

data/Figure_2.png

31.2 KB
Loading

data/expenses.csv

+30-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
11
id,amount,category,date,description
2-
1,500.0,Food,2024-06-21,Limits
3-
2,200.0,as,2024-06-21,fasfsdga
4-
3,600.0,ghjf,2024-06-21,fhdfgs
2+
1,50.0,Groceries,2024-01-05,Grocery shopping
3+
2,75.0,Utilities,2024-01-10,Electricity bill
4+
3,40.0,Entertainment,2024-01-12,Movie tickets
5+
4,20.0,Transport,2024-01-14,Bus fare
6+
5,60.0,Dining,2024-01-15,Dinner at a restaurant
7+
6,30.0,Health,2024-01-18,Doctor visit
8+
7,100.0,Education,2024-01-20,Online course
9+
8,45.0,Shopping,2024-01-22,Clothes
10+
9,150.0,Insurance,2024-01-25,Health insurance
11+
10,10.0,Miscellaneous,2024-01-27,Stationery
12+
11,55.0,Groceries,2024-02-03,Grocery shopping
13+
12,80.0,Utilities,2024-02-10,Water bill
14+
13,35.0,Entertainment,2024-02-14,Concert tickets
15+
14,25.0,Transport,2024-02-18,Taxi fare
16+
15,70.0,Dining,2024-02-20,Lunch at a cafe
17+
16,40.0,Health,2024-02-22,Pharmacy purchase
18+
17,120.0,Education,2024-02-25,Course materials
19+
18,55.0,Shopping,2024-02-28,Shoes
20+
19,200.0,Insurance,2024-03-01,Car insurance
21+
20,15.0,Miscellaneous,2024-03-05,Gift
22+
21,60.0,Groceries,2024-03-07,Grocery shopping
23+
22,90.0,Utilities,2024-03-10,Gas bill
24+
23,50.0,Entertainment,2024-03-14,Amusement park
25+
24,30.0,Transport,2024-03-18,Train fare
26+
25,80.0,Dining,2024-03-20,Dinner at a restaurant
27+
26,50.0,Health,2024-03-22,Dentist visit
28+
27,150.0,Education,2024-03-25,Textbooks
29+
28,65.0,Shopping,2024-03-28,Accessories
30+
29,250.0,Insurance,2024-03-30,Home insurance
31+
30,20.0,Miscellaneous,2024-03-31,Cleaning supplies

data/expenses.db

0 Bytes
Binary file not shown.

data/pdf.pdf

20.3 KB
Binary file not shown.

requirements.txt

168 Bytes
Binary file not shown.
362 Bytes
Binary file not shown.

src/__pycache__/data.cpython-312.pyc

3.01 KB
Binary file not shown.

src/__pycache__/gui.cpython-312.pyc

741 Bytes
Binary file not shown.
413 Bytes
Binary file not shown.

src/controller.py

+7
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ def get_expenses(self):
7474
except Exception as e:
7575
print(f"Error getting expenses: {e}")
7676
return []
77+
78+
def get_expenses_charts(self):
79+
try:
80+
return self.model.get_expenses_charts()
81+
except Exception as e:
82+
print(f"Error getting expenses: {e}")
83+
return []
7784

7885
def get_categories(self):
7986
try:

0 commit comments

Comments
 (0)