Skip to main content

Quantifiy and keep tabs on habits.

Project description


habiter quantifies and keeps track of habits within the command line.

It essentially addresses the problem of managing our habits (whether good or bad) by making it out in the open for us to see by simply tracking the number of occurrences we notice with our habits per day. This data can then be viewed at any time as well manipulated by using particular math concepts (e.g. Poisson approximation) to provide some means to visualize these habits.

Features

  • CLI interaction using the click library
  • Addition, deletion, updating of habits through the cooperation of the sqlite3 library
  • Persistent data storage onto your local machine; your data is yours to own and use alone
  • Poisson probability is utilized to act upon your data (more mathematical concepts to come)
  • Ability to print summary information of your habits

Installation

pip install habiter

Alternatively, you can clone the repository, though all interaction must take place at the root directory of the repo (usage explained below for both).

To Do's

  • Provide a configuration command to allow, as one may guess, the ability to configure habiter
  • "Pretty" up the list command print-outs (rich looks pretty neat!)
  • Implement an "undoing" feature to restore the habit record to previous states
  • Introduce more math concepts that work nicely with the data under consideration

Usage

If you installed habiter with pip, simply call habiter anywhere to get started.

If you cloned the repo, use the following (assuming you're in the project root directory and 'python3' command is your Python intrepreter):

python3 -m habiter.internal.run

➜  habiter -h
[habiter]  Last accessed: 15 Jan, 1505 1:21AM

Usage: habiter [OPTIONS] COMMAND [ARGS]...

  Quantifies and keeps tabs on unwanted habits you have developed over time.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  add     add new habit(s) into record
  list    list all habits on record
  remove  delete habit(s) from record
  reset   reset some habit(s) from record
  tally   increment the number of occurrences for some habit(s)

  For more information, visit the code repository at
  https://github.com/kemzeb/habiter.

This is what is printed out after the -h option is requested (just typing habiter also does the trick). We will analyze each subcommand found above and any of its optional arguments.

tally subcommand allows for incrementing the occurrence of one or more habits that exists within the record. It keeps track of daily and total habit occurrence (aka 'tallies') day by day. It holds the following options:

  • -z, --zero for informing habiter that you have had no tallies for that day for some habit(s)
  • -n, --num for providing a particular number of occurrences for that day for some habit(s) (please note that it applies to all habits that you currently inputted)

The reason why the -z, --zero option exists in the first place is because habiter doesn't run as a daemon, where habit data could be updated automatically based on meeting certain time constraints. You could supply -n 0 as input and this is essentally the same thing, but since there is a good chance that you have had no tallies for a habit on a particular day it becomes too cumbersome. The zero option simply informs habiter that the habits you supplied as input should be considered active today. If you tally afterward you won't find any trouble but you will exit with an error if you attempt to use this option again for that particular habit.

add subcommand allows for the addition of one or more habits into the record. If a habit already exists in the record, it will exit with an error but will not hinder the addition of any other inputted habit names.

remove subcommand allows for the deletion of one or more habits from the record. Similar to add, a habit that does not exist within the record will exit with an error but will not hinder the deletion of any other inputted habit names.

reset subcommand allows resetting one or more habits from the record to the initial state. Recorded total and daily tallies, number of days captured, and other information will no longer exist, but the habit will remain in the record.

list subcommand allows for the printing of all existing habits within the record. Its functionality can be extended using the following option:

  • -l, --less for listing only the habit names in the record

The following provides an example of the list command in action:

➜  habiter list
Habit + Attributes                    Value
-------------------                   -----
[mirror-writing]
  | P(Occurrences >= 2 today):        91.717%
  | Today's daily tally:              15
  | Total tally:                      1452
  | # of days captured:               352
  | Last updated:                     0 day(s) ago
  | Date added:                       15 Jan, 1505 1:21AM

[sculpting]
  | P(Occurrences >= 2 today):        48.854%
  | Today's daily tally:              15
  | Total tally:                      578
  | # of days captured:               352
  | Last updated:                     0 day(s) ago
  | Date added:                       15 Jan, 1505 1:22AM

-------------------                   -----
[habiter]  Note: More data captured = increased statistical accuracy!

You can also be more specific by passing habit names. For example:

➜  habiter list mirror-writing
Habit + Attributes                    Value
-------------------                   -----
[mirror-writing]
  | P(Occurrences >= 2 today):        91.717%
  | Today's daily tally:              15
  | Total tally:                      1452
  | # of days captured:               352
  | Last updated:                     0 day(s) ago
  | Date added:                       15 Jan, 1505 1:21AM

-------------------                   -----
[habiter]  Note: More data captured = increased statistical accuracy!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

habiter-0.8.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

habiter-0.8.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file habiter-0.8.0.tar.gz.

File metadata

  • Download URL: habiter-0.8.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for habiter-0.8.0.tar.gz
Algorithm Hash digest
SHA256 71fb29f98edf84edcba4c0bafaecdb79ec9475f505e78d129be366300570cc50
MD5 aea5c0eb5db7108d38038595570d10a5
BLAKE2b-256 43913b754d6d09d54abdf93926dc2092f495d4e4df73c25ddb31224dbd62ba9d

See more details on using hashes here.

File details

Details for the file habiter-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: habiter-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for habiter-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a06af4e0ece29f2a9033c0bafbb75bc1efc4f38645a4140dec118bf862d9bb7
MD5 38f74fac65f844e0910fe01715c5b734
BLAKE2b-256 00368eeba4f4183feb588ccba25b66b213f691afff27be4a406dddfecc842806

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page