Habit_X is a flexible habit tracking application designed to help you build and maintain habits with ease. Track your habits daily or weekly, monitor your streaks, and gain insights into your consistency — all from the command line or an interactive TUI (Text-based User Interface).
- Python 3.8+
- Recommended: Use a virtual environment for managing dependencies.
- If you are running this in Windows, make sure Python is added to your system's PATH/environment variables so you can run
habit_xfrom anywhere.
- Track daily or weekly habits
- Automatically calculate current, longest, and average streaks (consistency)
- View most/least consistent habits
- Timezone-aware tracking. All data is stored in UTC but can be displayed in user selected Timezone
- Simple CLI and full-screen TUI for managing and visualizing habits
- Lightweight SQLite + Peewee ORM backend
Make sure you have Python 3.8+ or above installed.
- Install from a Build:
- Download the latest .whl or .tar.gz file from the dist/ folder (or GitHub Releases).
- Click and Run the .whl file or use the following command to install application from terminal
pip install habitx-0.1.0.tar- Install from Source:
git clone https://github.com/devmadhava/habitx.git
cd habit_x
pip install .You can use habit_x in two ways:
- In TUI Mode: Just run either of these two commands
habit_xor
habit_x runTo exit the TUI mode you have to just press Ctrl + C
- In CLI Mode: Run specific commands directly:
habit_x <command> [options]Add a new habit.
| Flag | Description | Example |
|---|---|---|
| -n | Habit Name | Example: habitx -n "Running Daily" |
| -d | Description of the Habit | Example: habitx -d "Run 10 KM everyday" |
| -f | Habit Frequency (Daily or Weekly) | Example: habitx -f daily |
Example:
habitx add -n Running -d "Lets Run 12 KM a day" -f DAILYDelete a habit by ID.
| Flag | Description | Example |
|---|---|---|
| -i | ID of the habit to delete. If not provided, user will be prompted. | Example: habitx delete -i 1 |
Example:
habitx delete -i 1Edit a habit’s name and/or description.
| Flag | Description | Example |
|---|---|---|
| -i | ID of the habit to edit. If not provided, user will be prompted. | Example: habitx edit -i 1 |
| -n | The new name of the habit. | Example: habitx edit -i 1 -n "Morning Jog" |
| -d | The new description of the habit. | Example: habitx edit -i 1 -d "Jogging for 30 minutes every morning" |
Example:
habitx edit -i 1 -n "New Name" -d "New Description"Mark a habit as completed for today.
| Flag | Description | Example |
|---|---|---|
| -i | ID of the habit to mark as completed. If not provided, user will be prompted. | Example: habitx mark -i 2 |
Example:
habitx mark -i 1Unmark (undo) a completion for a habit.
| Flag | Description | Example |
|---|---|---|
| -i | ID of the habit to unmark. If not provided, user will be prompted. | Example: habitx unmark -i 2 |
Example:
habitx unmark -i 1"List all habits with optional filters.
| Flag | Description | Example |
|---|---|---|
| -d | Habit Creation Date | Example: habitx -d 01.01.2020 |
| -c | Date in which Habit was completed | Example: habitx -c 01.01.2020 |
| -f | Habit Frequency (Daily or Weekly) | Example: habitx -f daily |
| -streak | Indicates If user wants to fetch streaks data (Boolean) | Example habitx -streak |
Example:
habitx list -streak -d 01.01.2020 -f "DAILY" -c 02.02.2020Show streak statistics for a habit.
| Flag | Description | Example |
|---|---|---|
| -i | ID of the habit to view streaks for. If not provided, user will be prompted. | Example: habitx streak -i 1 |
Example:
habitx streak -i 1Show most and least consistent habits.
| Flag | Description | Example |
|---|---|---|
| N/A | No flags required. Displays consistency metrics for all habits. | Example: habitx consistent |
Example:
habitx consistentManage user preferences.
| Flag | Description | Example |
|---|---|---|
| -e | If True, prompts the user to edit their configuration. | Example: habitx user -e |
| -n | The new username. If None, prompts the user. | Example: habitx user -n "NewUsername" |
| -tz | The new timezone. If None, prompts the user. | Example: habitx user -tz "America/New_York" |
| -c | The new terminal color. If None, prompts the user. | Example: habitx user -c "green" |
Example:
habitx user -n "New Name" -c "Red" -tz "Europe/Berlin"Start the Text User Interface.
Launch it with either
habitxor
habitx runhabit_x/
├── habit_tracker/ # Main package
├── tests/ # Pytest test suite
├── dist/ # Contains .whl and .tar.gz builds
├── docs/ # Contains documentation for application
├── setup.py # Installation script
└── README.mdTo run the full test suite using pytest:
- Clone the Repository
- Install the requirements
- Run the following command
pytest