A toy-level timer built with Python. The project allows you to easily track your study or working time and visualize it in a calendar heatmap format.
- Start and stop the timer by running
Tracker.py
- Track cumulative durations for the current week and month
- Record daily durations throughout the year
- Visualize the recorded data as a calendar heatmap using
Visualizer.py
Required Python packages:
- pandas
- plotly
- plotly_calplot
You can install these packages using pip:
pip install pandas plotly plotly_calplot
- Start the Timer: Run
Recorder.py
for the first time to start timing. - Stop the Timer: Run
Recorder.py
again to stop timing. - View Statistics: When stopping the timer, the script prints cumulative durations for the week and month.
- Visualize Data: Run
Visualizer.py
to generate a calendar heatmap showing recorded daily durations.
- If
start_time.json
is not detected, record the start time. - Otherwise, calculate the time difference and update daily, weekly, and monthly durations. Then delect
start_time.json
.
Visualizer.py uses plotly_calplot
to create a heatmap representation of daily recorded times.
.
├── Tracker.py
├── Visualizer.py
├── data/
│ ├── start_time.json
│ ├── date_time_.json
│ ├── monthly_weekly_total.json
├── README.md
Please delete the data
folder before using this project - it's
just my test data in there.
When visualizing a calendar heatmap using plotly_calplot
,
in order to maintain a complete rectangular shape for the heatmap,
the package includes some dates from the previous year before the start of each year
and some dates from the following year after the end of each year.
Hovering the mouse over these dates display strange things.
Don't try to run this across time zones - who knows what might happen:D
I'd be very happy if this project helps you.
Please feel free to contact me at: ynhan@zju.edu.cn