Add grouping to the output of list
When running the list command it would be useful to have the option to group the output by project and/or description and provide totals for each group.
An example output could be:
2025-02-10 Project A 5h 00m 09:00 10:00 task A Project A 1h 00m 10:00 13:00 task B Project A 3h 00m 15:00 16:00 task A Project A 1h 00m
Project B 4h 30m 13:00 14:30 task A Project B 1h 30m 13:00 14:30 task B Project B 1h 30m 13:00 14:30 task A Project B 1h 30m
Grouping by task and project could output
2025-02-10 Project A taskA 2h 00m 09:00 10:00 task A Project A 1h 00m 15:00 16:00 task A Project A 1h 00m
Project A taskB 3h 00m 10:00 13:00 task B Project A 3h 00m
Project B task A 3h 00m 13:00 14:30 task A Project B 1h 30m 13:00 14:30 task A Project B 1h 30m
Project B task B 1h 30m 13:00 14:30 task B Project B 1h 30m
I suggest adding the following flags --group_project - gp --group_description -gd
I can actively work on this and provide a pull request shortly
How would this differ from bartib report?
This differs because the report functionality provides totals for each project calculated over the date range provided.
In organisations where you have to provide a day by day breakdown of time this is not useful.
Perhaps the functionality I suggested should be part of the report function though, maybe via a --daily flag?
Ok, I see how this would be useful. It would be a nice enhancement for the report subcommand. If the user defines a time range which spans over several days and sets the --daily flag it would give a report for each individual day. In every other case it would work like before.
Upon further thought, I am going to propose that we add a --group option which accepts combinations of the following characters: p - project d - description c - calendar (date)
The combination and order determines what grouping is applied to the report action.
some examples are (with poorly formatted outputs): bartib report -g cpd this would generate a report showing the total duration for descriptions in projects in days
2025-02-10 2h 00m
Project B 2h 00m
task A 1h 00m
task B 1h 00m
2025-02-11 2h 00m
Project B 2h 00m
task A 1h 00m
task B 1h 00m
bartib report -g dpc
task A 2h 00m
Project A 2h 00m
2025-02-10 1h 00m
2025-02-11 1h 00m
Project B 2h 00m
2025-02-10 1h 00m
2025-02-11 1h 00m
task B 2h 00m
Project A 2h 00m
2025-02-10 1h 00m
2025-02-11 1h 00m
Project B 2h 00m
2025-02-10 1h 00m
2025-02-11 1h 00m
The existing report functionality is the equivalent of the command below (This could be left as the default functionality): bartib report -g pd
This looks nice. I think it could work very well like this. If you would like to implement this, I would be happy to accept a pull request.
I have a working version of this, I just need to tidy it up and implement some error handling and I will issue a PR