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

[Feature Request] Review historical data #32

Closed
crashmoney opened this issue Dec 31, 2023 · 3 comments
Closed

[Feature Request] Review historical data #32

crashmoney opened this issue Dec 31, 2023 · 3 comments
Assignees

Comments

@crashmoney
Copy link

I've been using habito for a while and very much appreciate it balancing simplicity and the ability to track quantities. However, I noticed that habito only displays (even in habito list -l) the last 8 days – is there any way to pull historical data to compare, say, how many minutes I exercised last week to this week? That's just one use case I can think of, and exposing previous data would open up avenues for our own processing and potential future features (e.g. charts, stats).

If it helps, other similar CLIs (e.g. the Watson time tracker, also written in Python) use a syntax like --from 2023-12-18 --to 2023-12-31 to specify date ranges.

Thank you for your work on habito!

@codito
Copy link
Owner

codito commented Dec 31, 2023

Thanks @crashmoney for the feature suggestion! This is a great idea and Watson's report command is inspiring.

To start with, would a simple export to csv or json work for the use case mentioned?

For advanced aggregation/stats, we can possibly enhance the habito list command (today it is per-day for a week) to be (per-week for a month) or customizable (per-X days for N period). Something like below:

Habit Week 51 Week 52 [current]
Writing (in words) 750 300
Wake up early (in instances) 7 3

Tabular display will be limited by the horizontal screen estate though. Eventually this can evolve to some nice charts etc. using plotext.

@crashmoney
Copy link
Author

Yes, I think so! A csv export would be great for piping into an Excel graph, for instance. The table and potential expansion to graphs you're suggesting sound very helpful for immediate visualisation as well. If at all possible, having built-in time period flags (e.g. --month or --week) would make looking back a breeze. Thanks for the prompt reply, @codito 😄

@codito codito self-assigned this Jan 1, 2024
@codito
Copy link
Owner

codito commented Jan 13, 2024

Added csv listing in v1.2.0. Docs: https://codito.github.io/habito/commands/#syntax_1

> habito list -l -f csv -d "3 days"

id,name,goal,units,date,activity
1,running,3.0,miles,2023-02-16,0.0
1,running,3.0,miles,2023-02-17,3.1
1,running,3.0,miles,2023-02-18,3.0

@codito codito closed this as completed Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants