Save daily statistics of each work/break period into a CSV file
- Simple local CSV file for those who want's to analyse their data.
- No servers/internet needed. Everything is saved locally at a location provided by user.
- Append only writing for each completed task.
CSV Contents
| date | unix-date | start-time | unix-start-time | end-time | unix-end-time | pauses | type | configured-time | actual-time |
|---|---|---|---|---|---|---|---|---|---|
| 2020/01/20 | 6:55AM | 7:15AM | 0 | WORK | 1200 | 1200 |
- Both human readable dates and unix dates are provided. Human readable date is in current timezone. Unix time will be UTC time.
- Why UNIX time? Situations where you are working in multiple time-zones (& system is properly updated with new time). Unix time still works.
-
types: WORK, SBREAK, LBREAK -
pauses: Total pauses you did -
configured-time: What is the time configured for this type of work -
actual-time: Actually taken time including pauses within same work/break period. This can also be calculated byunix-end-time - unix-start-time. Provided for convenience.
Neat! This interests me :P
I'm not sure if these statistics are useful though. But we could make a simple framework for saving statistics and then, after the framework is done, it should be easy enough to add, remove or modify which stats are being saved.
It's good that we already have config file now. We can add configurable features.
So here's what I was thinking:
- Change
.pydoro.initopydoro.iniinside a~/.pydorofolder (configurable through env var) - Put
stats.csvinside.pydorofolder - Only work with unix timestamps (for
start_timeandend_time) and unix dates. Treat to local timezone only when writing to CSV
- Pydoro started
-
start_time = time.time() -
date = today> dunno how I'll do this yet -
start_pause = start_time> time before first work session is handled as a pause (but don't count inpauses
-
- Work paused
-
start_pause = time.time() -
pauses += 1
-
- Work resumed (or began)
-
total_pause_time += time.time() - start_pause
-
- Quit Pydoro
-
overall_time = time.time() - start_time -
total_work_time = overall_time - total_pause_time - Treat timezones
- Append data to CSV file
-
- If user doesn't quit nicely (e.g. CTRL+C), don't save stats (maybe improve that in the future)
@gmelodie I think that's sufficient let's not worry about time-zone at the moment.
We shouldn't make it automatically collect stats. It should only be enabled from command line or .ini file. 🤔
Oh I forgot to say that. I added a --no-stats argument to the CLI and the equivalent to the ini file. Should I change that to --collect-stats instead?
Yes please.
This feature is still need to implement or already existing? I didn't find the function usage in documentation. It looks useful feature to have.
It still need to be implemented.
On Mon, Apr 3, 2023, 3:51 AM GmGniap @.***> wrote:
This feature is still need to implement or already existing? I didn't find the function usage in documentation. It looks useful feature to have.
— Reply to this email directly, view it on GitHub https://github.com/JaDogg/pydoro/issues/88#issuecomment-1493563394, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADZXUUGTSZSMPL4HCB4OU3W7I3J7ANCNFSM4KLVIGOQ . You are receiving this because you authored the thread.Message ID: @.***>