Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save daily statistics of each work/break period into a CSV file #88

Closed
JaDogg opened this issue Jan 26, 2020 · 8 comments
Closed

Save daily statistics of each work/break period into a CSV file #88

JaDogg opened this issue Jan 26, 2020 · 8 comments
Labels
awesome 🤘 enhancement New feature or request help wanted Extra attention is needed

Comments

@JaDogg
Copy link
Owner

JaDogg commented Jan 26, 2020

  • 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 by unix-end-time - unix-start-time. Provided for convenience.
@JaDogg JaDogg added enhancement New feature or request help wanted Extra attention is needed labels Jan 26, 2020
@JaDogg JaDogg changed the title Save daily statistics of each 🍅 into CSV file Save daily statistics of each work/break period into a CSV file Jan 26, 2020
@gmelodie
Copy link
Contributor

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.

@JaDogg
Copy link
Owner Author

JaDogg commented Jan 26, 2020

It's good that we already have config file now. We can add configurable features.

@gmelodie
Copy link
Contributor

gmelodie commented Apr 21, 2020

So here's what I was thinking:

  • Change .pydoro.ini to pydoro.ini inside a ~/.pydoro folder (configurable through env var)
  • Put stats.csv inside .pydoro folder
  • Only work with unix timestamps (for start_time and end_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 in pauses
  • 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)

@JaDogg
Copy link
Owner Author

JaDogg commented Apr 22, 2020

@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. 🤔

@gmelodie
Copy link
Contributor

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?

@JaDogg
Copy link
Owner Author

JaDogg commented Apr 23, 2020

Yes please.

@GmGniap
Copy link

GmGniap commented Apr 3, 2023

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.

@JaDogg
Copy link
Owner Author

JaDogg commented Apr 3, 2023 via email

@JaDogg JaDogg closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awesome 🤘 enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants