File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed
Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 1+ # Finance Dashboard
2+
3+ This is a beginner-friendly finance dashboard built with Flask.
4+ It allows users to track expenses and view total spending.
5+
6+ ## Setup
7+ 1 . Install requirements:
8+ ``` bash
9+ pip install -r requirements.txt
Original file line number Diff line number Diff line change 1- ##finance dashboard issue :]
1+ ##finance dashboard issue :]
2+ from flask import Flask , render_template_string
3+
4+ app = Flask (__name__ )
5+
6+ # Sample expense data
7+ expenses = [
8+ {"category" : "Food" , "amount" : 120 },
9+ {"category" : "Rent" , "amount" : 800 },
10+ {"category" : "Transport" , "amount" : 60 },
11+ ]
12+
13+ @app .route ("/" )
14+ def dashboard ():
15+ total = sum (e ["amount" ] for e in expenses )
16+ categories = ", " .join (e ["category" ] for e in expenses )
17+ return render_template_string ("""
18+ <h1>Finance Dashboard</h1>
19+ <p><b>Total Spending:</b> ${{ total }}</p>
20+ <p><b>Categories:</b> {{ categories }}</p>
21+ """ , total = total , categories = categories )
22+
23+ if __name__ == "__main__" :
24+ app .run (debug = True )
Original file line number Diff line number Diff line change 1+ flask
2+ matplotlib
You can’t perform that action at this time.
0 commit comments