wakatara / harsh

Habit tracking for geeks. A minimalist, command line tool for tracking and understanding your habits.
MIT License
132 stars 11 forks source link

Also write an entry in a ledger journal file #18

Closed kiil closed 2 years ago

kiil commented 2 years ago

We're trying to keep harsh as minimal as possible, but...

Is your feature request related to a problem? Please describe.

I would like to create an entry in a ledger journal file each time a habit is done

See eg https://www.reddit.com/r/plaintextaccounting/comments/wibbk2/tracking_chores_for_my_kids_but_i_need_a_way_to/

Describe the solution you'd like

A way to define a way to not only write to the log, but also to another file and define what to be written for each habit done:

eg for at habit called 'Alexander stuegulv' done on 2022-08-04 something like:

2022-08-04
    (Alexander stuegulv)              1
kiil commented 2 years ago

On second thought, it would probably be easier to import from the log file.

Maybe there could be an option to use 1, 0, -1 instead of y / s / n

wakatara commented 2 years ago

@kiil First off, thanks for using harsh! I hope it's proving useful.

As you noted, the best thing for you to do would be to simply import the log file and re-write the entries into the ledger form you need. You can do this with some simple shell scripting or python, but let me know if you need a hand on how to do that.

The log entries are handily separated with ":" characters to make parsing the file easy, so it should be fairly trivial to write the ledger format you need from that.

lemme know if you need some pointers though and how it goes!

(Am gonna close this though, as munging the log file format via import is outside the scope of the app.)