Loading repository data…
Loading repository data…
devmadhava / repository
habitx is a lightweight, Python-based CLI tool designed for effective habit management and tracking. It helps users build, maintain, and analyze their daily or weekly habits through simple terminal commands. With features like adding habits, marking completion, viewing streaks, and consistency analysis, habitx aims to build better routines.
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).
habit_x from anywhere.Make sure you have Python 3.8+ or above installed.
pip install habitx-0.1.0.tar
git clone https://github.com/devmadhava/habitx.git
cd habit_x
pip install .
You can use habit_x in two ways:
habit_x
or
habit_x run
To exit the TUI mode you have to just press Ctrl + C
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 DAILY
Delete 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 1
Edit 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 1
Unmark (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.2020
Show 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 1
Show most and least consistent habits.
| Flag | Description | Example |
|---|---|---|
| N/A | No flags required. Displays consistency metrics for all habits. | Example: habitx consistent |
Example:
habitx consistent
Manage 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
habitx
or
habitx run
habit_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.md
To run the full test suite using pytest:
pytest