Spaces:
Sleeping
Sleeping
shamimjony1000
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,21 +1,20 @@
|
|
1 |
-
# app.py
|
2 |
-
|
3 |
import streamlit as st
|
4 |
-
from task_operations import TaskManager
|
5 |
-
from task_visualization import TaskVisualizer
|
6 |
import pandas as pd
|
|
|
|
|
|
|
7 |
|
8 |
def main():
|
9 |
-
|
|
|
10 |
|
11 |
task_manager = TaskManager()
|
12 |
-
|
13 |
|
14 |
task_name = st.text_input("Task Name")
|
15 |
task_time = st.time_input("Task Time")
|
16 |
task_duration_hours = st.number_input("Task Duration (Hours)", min_value=0, step=1, format="%d")
|
17 |
task_duration_minutes = st.number_input("Task Duration (Minutes)", min_value=0, max_value=59, step=1, format="%d")
|
18 |
-
|
19 |
task_category = st.selectbox("Task Category", TaskManager.CATEGORIES)
|
20 |
|
21 |
if st.button("Add Task"):
|
@@ -38,43 +37,31 @@ def main():
|
|
38 |
|
39 |
if st.button("Daily Report"):
|
40 |
report = task_manager.generate_report('daily')
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
visualizer.plot_category_performance('daily', task_manager)
|
45 |
-
else:
|
46 |
-
st.warning("No tasks for today.")
|
47 |
|
48 |
if st.button("Weekly Report"):
|
49 |
report = task_manager.generate_report('weekly')
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
visualizer.plot_category_performance('weekly', task_manager)
|
54 |
-
else:
|
55 |
-
st.warning("No tasks for this week.")
|
56 |
|
57 |
if st.button("Monthly Report"):
|
58 |
report = task_manager.generate_report('monthly')
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
visualizer.plot_category_performance('monthly', task_manager)
|
63 |
-
else:
|
64 |
-
st.warning("No tasks for this month.")
|
65 |
|
66 |
if st.button("Yearly Report"):
|
67 |
report = task_manager.generate_report('yearly')
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
visualizer.plot_category_performance('yearly', task_manager)
|
72 |
-
else:
|
73 |
-
st.warning("No tasks for this year.")
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
|
79 |
if __name__ == "__main__":
|
80 |
main()
|
|
|
|
|
|
|
1 |
import streamlit as st
|
|
|
|
|
2 |
import pandas as pd
|
3 |
+
from components.task_operations import TaskManager
|
4 |
+
from components.task_visualization import TaskVisualizer
|
5 |
+
|
6 |
|
7 |
def main():
|
8 |
+
|
9 |
+
st.title("Daily Task Tracker")
|
10 |
|
11 |
task_manager = TaskManager()
|
12 |
+
task_visualizer = TaskVisualizer()
|
13 |
|
14 |
task_name = st.text_input("Task Name")
|
15 |
task_time = st.time_input("Task Time")
|
16 |
task_duration_hours = st.number_input("Task Duration (Hours)", min_value=0, step=1, format="%d")
|
17 |
task_duration_minutes = st.number_input("Task Duration (Minutes)", min_value=0, max_value=59, step=1, format="%d")
|
|
|
18 |
task_category = st.selectbox("Task Category", TaskManager.CATEGORIES)
|
19 |
|
20 |
if st.button("Add Task"):
|
|
|
37 |
|
38 |
if st.button("Daily Report"):
|
39 |
report = task_manager.generate_report('daily')
|
40 |
+
st.write("Daily Report:")
|
41 |
+
st.dataframe(report)
|
42 |
+
task_visualizer.plot_category_performance('daily')
|
|
|
|
|
|
|
43 |
|
44 |
if st.button("Weekly Report"):
|
45 |
report = task_manager.generate_report('weekly')
|
46 |
+
st.write("Weekly Report:")
|
47 |
+
st.dataframe(report)
|
48 |
+
task_visualizer.plot_category_performance('weekly')
|
|
|
|
|
|
|
49 |
|
50 |
if st.button("Monthly Report"):
|
51 |
report = task_manager.generate_report('monthly')
|
52 |
+
st.write("Monthly Report:")
|
53 |
+
st.dataframe(report)
|
54 |
+
task_visualizer.plot_category_performance('monthly')
|
|
|
|
|
|
|
55 |
|
56 |
if st.button("Yearly Report"):
|
57 |
report = task_manager.generate_report('yearly')
|
58 |
+
st.write("Yearly Report:")
|
59 |
+
st.dataframe(report)
|
60 |
+
task_visualizer.plot_category_performance('yearly')
|
|
|
|
|
|
|
61 |
|
62 |
+
task_visualizer.plot_performance()
|
63 |
+
task_visualizer.plot_overall_category_performance()
|
64 |
+
task_manager.download_report()
|
65 |
|
66 |
if __name__ == "__main__":
|
67 |
main()
|