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

Make report aggregation more flexible (or allow for tag summaries) #365

Open
joelostblom opened this issue Apr 24, 2020 · 3 comments
Open

Comments

@joelostblom
Copy link
Contributor

joelostblom commented Apr 24, 2020

Currently there is aggregate to group information by day,project,tag and report to group information by project,tag. For me, it would be useful to see an aggregation per tag to answer questions such as "how much time did I spend in meetings this week?" (similar to timewarrior's "totals" extension).

While thinking about preferred approach for adding this, I thought that instead of adding a new command or a flag to either report or aggregate, it could be better to reduce ambiguity and have a single command for all the grouping operations. So instead of having both of the similar aggregate and report command, you would just have report and then a --by flag for in which order to group/aggregate information by, e.g.

# Current behavior of `watson aggregate`
watson report --by day,project,tag

# Current behavior of `watson report`
watson report --by project,tag

# The tag summary I am interested in
watson report --by tag

This is conceptually similar to how groupby works in pandas dataframes and would allow for more flexibility when generating reports. This would also be backwards compatible since watson report could retain its current default behavior and watson aggregate could be made an alias for --by day,project,tag (possibly tagged for future deprecation).

If this is considered too big of an undertaking, I would still be interested in an option to just aggregate by tags. What do you think?

@joelostblom
Copy link
Contributor Author

I am happy to submit a PR if there is interest in this feature. I think it could be quite useful so I might start working on it for myself anyhow. I am thinking that the already existing sorted_groupby might be useful, but I will have to look into it more. If you have preferences for how this would be implemented, please let me know.

@joelostblom
Copy link
Contributor Author

Note that this suggestion conflicts with the suggested use of --by to order tags non-alphabetically as suggested in #362. Either that could become --order-by or this could become --group-by.

@j0hj0h
Copy link

j0hj0h commented May 9, 2023

Aggregation by week, month and year would be awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants