-
Notifications
You must be signed in to change notification settings - Fork 1
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
Time entries: group by #6
Comments
note: I can put together a quick prototype using https://docs.python.org/3/library/itertools.html#itertools.groupby |
Evaluate putting some visual hints with https://pypi.org/project/termgraph/ |
Prototyping a simple 'group by' sub-command for the 'entries' command: $ tgl entries group-by --field tags --start-date 2023-01-31
Time Entries
tags Duration
───────────────────────────
8 hours
type:meeting 3 hours
type:support 2 hours
type:sync an hour
type:goal 47 minutes
type:hr 44 minutes
|
We need an option to get more resolution on the duration. For example, sometimes I want "an hour", and sometime I want "1:23". We should add something like |
Here's the test result of switching from
to
result: $ tgl entries group-by --field tags --start-date 2023-02-01
Time Entries
tags Duration
───────────────────────────────────────
8 hours and 42 minutes
type:goal 5 hours and 4 minutes
type:sync 1 hour and 27 minutes
type:meeting 58 minutes
|
IMO this format is better suited for the granularity of this view. I'm considering to switching to this format as the only option. |
After a few tests, the most readable format at glance is the old So I guess I'm sticking with this: $ tgl entries group-by --field tags
Time Entries
tags Duration
─────────────────────────
type:meeting 3:31
2:32
type:support 1:37
type:sync 0:47
type:hr 0:09
|
The 'human' format is nice, but it make reading durations at glance harder. refs: #6
The next step is adding some project filtering capabilities, so I can only get the time entries for a specific project. I often want to list or group by entries for work or personal activities. |
Here's an example: $ tgl entries --project-id 178435728 group-by --field tags
Time Entries
tags Duration
─────────────────────────
type:meeting 2:53
type:support 1:37
type:sync 0:47
type:hr 0:09
|
The Time Entries API doesn't have filtering options, so I am filtering the response client side. Not great, we'll see if there are other options. refs: #6
I should add the total duration, maybe even a percentage. |
The Tables documentation on Rich is amazing https://rich.readthedocs.io/en/latest/tables.html |
The Rich's table has the option of adding a table footer. It adds an additional row visually distinct from the data rows: $ tgl entries --project-id 178435728 group-by --field tags --start-date 2023-01-30 Time Entries tags Duration ───────────────────────── type:support 9:40 type:meeting 7:38 type:goal 5:58 type:sync 5:08 type:hr 0:54 ───────────────────────── Total 29:20 refs: #6
I want use time entries to get insights about how a spend my time in a given time frame.
The first insight I want to get is the work type (goal, support, hr, sync): show me my work types split.
I usually tag time entries by a
type:WORK_TYPE
tag.For example:
The text was updated successfully, but these errors were encountered: