Skip to content

A simple console application to define your personal habits and track their completion status.

License

Notifications You must be signed in to change notification settings

smartIU/habit-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Habit Progress Tracker

A simple console application to define your personal habits and track their completion status.

Features

  • Create habits that can be checked off instantly or that need to accumulate progress over time
    • When creating your habits this is reflected by the "amount of progress required to complete the task", choose "1" or leave this property empty for a check-off task
  • Supports daily, weekly and monthly tasks as well as freely defined periods spanning any number of days
    • Note that weekly periods always start on Mondays and monthly periods on the 1st of the month, whereas freely defined periods start on the day you create the respective habit
  • A Lightweight SQLite database file to store your habits is created automatically upon start

Installation

The app only requires python version 3.10 or newer to be installed on your machine. There are no further dependecies and therefore no additional setup steps.

Windows

Install Python from Python Download, checking "Add Python to PATH"

or use the precompiled release of the app for Windows x64.

Linux

Install Python manually from Python Download

or use git:

# Debian-based:
sudo apt install wget git python3 python3-venv
# Red Hat-based:
sudo dnf install wget git python3
# Arch-based:
sudo pacman -S wget git python3

macOS

Install Python from Python Download and follow the instructions on How to run a python script

To run the habit tracker from the Terminal window you must make sure that /usr/local/bin is in your shell search path.

To run the habit tracker from the Finder you have two options:

  • Drag it to PythonLauncher

  • Select PythonLauncher as the default application to open tracker.py (or any .py script) through the finder Info window and double-click it.

Usage

Simply run the tracker.py script from the root directory

tracker.py

or the tracker.exe, if you're using the precompiled release for Windows x64.

tracker.exe

First start

start_empty

When you start the application for the first time, you have the option to either create your own habit or insert a set of predefined habits.

Interactive mode

As soon as there is at least one habit defined, all actions of the app open up.

list

To select an action from the menu, type the according number and press the "Enter" key.

update

For some actions like creating or updating a habit, you have to manually enter a value. Simply follow the prompt on the screen.

You can conduct a variety of analyses with different filter options.

completion rate

When conducting an analysis for a specific timeframe, note that habits with a period greater than the timeframe will not be included. For example, when analysing the last week, monthly habits will not be featured in the result.

Command line requests

Every action from the interactive mode is also available directly via command line. Start the script or .exe with "-h" as an argument to get help for each individual command.

tracker.py -h

help

You can get the results in the same format as in interactive mode, for example, when querying the longest streak of all weekly habits:

max_streak

Or you can append "--json" to get results as a json object suitable for further processing, for example, if you intend to use the app as a backend for your own GUI:

json

For a full list of all available command line requests as well as examples on how to answer common questions like "With which habits did I struggle most last month?", please refer to the Wiki.

Test

There are 100 unit tests defined to validate every action you can perform with the app. Only parsing of the user input / creating and navigating through the interactive menu is not covered.

To run the tests by yourself, you have to first install pytest. You can use pip to achieve this:

pip install pytest

Then navigate to the root of the app directory (i.e., where "tracker.py" is located) and run the following command:

python -m pytest -v

Note that simply running "pytest ." without "python -m" will not work, because the test_tracker.py file is located in a subdirectory.

The output of the test should then look like this:

pytest

Disclaimer

No part of the app or its documentation was created by or with the help of artificial intelligence.

About

A simple console application to define your personal habits and track their completion status.

Topics

Resources

License

Stars

Watchers

Forks

Languages