An open API service indexing awesome lists of open source software.

https://github.com/asuntx/habitpy

a complete CLI habit tracker written in python
https://github.com/asuntx/habitpy

habit-tracker habits track

Last synced: 3 months ago
JSON representation

a complete CLI habit tracker written in python

Awesome Lists containing this project

README

          

# HabitPy

**Track your habits, analyze your progress, and stay motivatedβ€”all from your terminal!**

## Features

- πŸ“… **Daily & Weekly Tracking:** Log your habits (only numbers)
- ✏️ **Custom Habits:** Add, show, or delete any habit you want to track.
- πŸ“ˆ **Visualize Progress:** Instantly generate beautiful graphs (with dark mode!) for your week, month, or year.
- πŸŽ‰ **Motivational Cheers:** Get random motivational messages to keep you going.
- πŸ“€ **Export Data:** Export all your habit data to CSV for use in Excel, Sheets, or anywhere else.
- πŸ› οΈ **Easy Reset:** Reset your data and start fresh anytime.

---

## Installation

### πŸ”§ Prerequisites

Before building or running HabitPy, create a virtual environment and install dependencies:

```bash
# Clone the repo
git clone https://github.com/asuntx/habitpy.git
cd habitpy

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate

# Install dependencies
pip install .
```

---

### πŸš€ Option 1: Build and Install from Source (Recommended)

note: \* is the version and name it might change so just copy the name of the whl file

```bash
# Build the distribution
python -m build

# Install the built package globally
pip install dist/habitpy-*.whl
```

---

### ⚑ Option 2: Use pipx (Recommended for CLI tools)

```bash
# Build the distribution
python -m build

# Install with pipx (ensures global availability)
pipx install dist/habitpy-*.whl
```

---

### πŸ§ͺ Option 3: Development Installation

#### With pip (editable mode)

```bash
# Already inside .venv
pip install -e .
```

#### With uv

```bash
uv sync
uv run habitpy setup
```

#### With pipx (editable mode)

```bash
pipx install -e .
```

---

## πŸ•ΉοΈ Usage

First, set up your tracker:

```bash
habitpy setup
```

Then, use the commands:

- `habitpy track ` β€” Log today’s habits
- `habitpy create ` β€” Add a new habit
- `habitpy show` β€” List all habits
- `habitpy delete ` β€” Remove a habit
- `habitpy graph week|month|year` β€” Visualize progress
- `habitpy export` β€” Export data to CSV
- `habitpy reset` β€” Delete all data and start over

---

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W7W318WNN8)

---