· terminal habit tracker ·

pyhabits

A light, Python-based terminal app for tracking your habits. It takes less than 30 seconds to log your day.

Get it on GitHub
pyhabits.py — PowerShell
PS C:\Users\Anna\pyhabits> .\pyhabits.py
....   pyhabits   ....
terminal habit tracker   ·   Friday, 4 April
1·Track Habit
2·View Habits
3·Generate Visualization
4·Manage Habits
5·View Stats
6·Undo Habit
7·Exit
▶ Choose — type 1–7, then Enter:

Features

Built for flow

Log your habits and get on with your day. Use pyhabits for the high-speed capture, then take your data elsewhere for deep analysis.

✓
Track in seconds
Pick a habit by number or name, mark it done, move on.
☰
Categories & icons
Group habits by category, add optional icons, and attach measurements like "30 min".
◫
Views
View daily, weekly, monthly logs. Daily logs for focus. Monthly logs for analyzing the big picture of how you're doing with your habits.
⌘
Exports & visualizations
Export as JSON, CSV, or Markdown. Generate a print-ready HTML/PDF annual habit log page.
⊘
Archive, don't delete
Hide habits you've outgrown without losing their history. Your record stays intact.
◈
100% local & private
Data lives in a plain user/habits.json file. No accounts, no sync, no telemetry.
∑
Stats & streaks
Track current and longest streaks, completion rates, and total counts per habit.

What to do with your data

A starting point for your own projects

Your habits live in a plain JSON file. Take that file wherever you want — there's nothing proprietary here.

→ Obsidian / Logseq
Export as Markdown and drop files directly into your vault for a permanent, searchable record.
→ Excel / Google Sheets
Import CSV or JSON to build your own long-term trend charts and analysis.
→ Print & bullet journal
Generate a print-ready annual habit log page HTML/PDF page, print it out, and keep a physical record in your bullet journal or desk archive.
→ Jupyter / custom scripts
Open the raw habits.json in any Python script or notebook for deeper analysis.

Python 3.8+

WeasyPrint handles PDF export. pyfiglet renders the terminal logo. Windows users need the GTK runtime for PDF support.

Python 3.8+ pyfiglet WeasyPrint GTK runtime (Windows PDF)
$git clone https://github.com/annaozola/pyhabits
$cd pyhabits
$pip install -r requirements.txt
# Windows PDF: also install GTK runtime
$python pyhabits.py

Windows users: run .\pyhabits.py in PowerShell.