4 ms·
I have tried some similar things. I like your approach and write-up a lot! You asked about tools. Well, from the "when you have a hammer" department.. you coul
by simonmic 3y ago
I have tried some similar things. I like your approach and write-up a lot!
You asked about tools. Well, from the "when you have a hammer" department..
you could use plain text accounting tools for some quick reporting wins.
Some examples:
If you have a.dat:
2020-05-28 18:41 Eat Pizza
2020-05-29 09:00 Slept with the window open
2020-05-29 09:00 Headaches
This is close enough to hledger's timedot format to do some reporting.
Each line is interpreted as an empty transaction,
which you could query by date or description:
$ hledger -f timedot:a.dat print
2020-05-28 * 18:41 Eat Pizza
2020-05-29 * 09:00 Slept with the window open
2020-05-29 * 09:00 Headaches
$ hledger -f timedot:a.dat print date:2020/5/28
2020-05-28 * 18:41 Eat Pizza
$ hledger -f timedot:a.dat print desc:eat
2020-05-28 * 18:41 Eat Pizza
You could transform your data to a plain text accounting format, with quantities. Eg, make it TSV:
$ perl -pe '$c=0; $c++ while $c < 2 && s/ /\t/' a.dat > c.tsv
$ cat c.tsv
2020-05-28 18:41 Eat Pizza
2020-05-29 09:00 Slept with the window open
2020-05-29 09:00 Headaches
and use hledger CSV conversion rules to customise and enrich it:
$ cat c.tsv.rules
fields date, time, description
# save the time as a tag
comment time:%time
# count each item as one "event" by default
account1 (events)
amount1 1
# special cases
if pizza
account1 (food)
amount1 200 cal
Now you have a (single entry) accounting journal:
$ hledger -f c.tsv print
2020-05-28 Eat Pizza ; time:18:41
(food) 200 cal
2020-05-29 Slept with the window open ; time:09:00
(events) 1
2020-05-29 Headaches ; time:09:00
(events) 1
Allowing quantity reports:
$ hledger -f c.tsv balance -MATS cur:cal
Balance changes in 2020-05:
|| May Total Average
======++===========================
food || 200 cal 200 cal 200 cal
------++---------------------------
|| 200 cal 200 cal 200 cal
$ hledger -f c.tsv activity -D desc:headache
2020-05-28
2020-05-29 *
$ hledger-bar -v -f c.tsv cur:cal
2020-05 200 ++
$ hledger-ui --all -f c.tsv # explore with a TUI
More at https://github.com/simonmichael/hledger/tree/master/examples/self-tracking https://github.com/simonmichael/hledger/tree/master/examples...
- mg 3y agoWith "tools" I meant statistical tools, aka statistical tests. Because the log is a time series where events happen at random times, the typical tests like the t-test are not readily applicable. One way I am currently generating p-values is to look at questions like "When I did X / did not do X - how often did Y happen within the next 24 hours?". And put those numbers into statistical tests like the t-test. But since "Y" often is not just something that happened but something that has a value (For example "High energy / normal energy / a little tired / very tired") this discards some data. This and many other specifics in a random-interval-event-log probably allow for better tests than I came up with so far.