· 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 See features
pyhabits.py — PowerShell
PS C:\Users\Anna\pyhabits> .\pyhabits.py
....   pyhabits   ....
terminal habit tracker   ·   Friday, 4 April
1·Track a habit for today
2·View habits for today
3·View habits for this week
4·View habits for this month
5·Generate visualization (HTML/PDF)
6·Manage habits
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 habits.json file. No accounts, no sync, no telemetry.

How it works

Clone. Run. Done.

pyhabits runs in your terminal.

01
Clone the repo
git clone https://github.com/annaozola/pyhabits
02
Install the one dependency
Only pdfkit is needed for Python. For PDF export, also install wkhtmltopdf — HTML export works without it.
pip install pdfkit
03
Run it
Navigate to the folder and fire it up. Works on Windows, macOS, and Linux.
python pyhabits.py
04
Track your first habit
Type 1 right after opening the app to pick the track a habit for today option and start tracking your first 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+

That's the only real requirement. pdfkit covers PDF export; everything else is standard library.

Python 3.8+ pdfkit wkhtmltopdf (PDF only)
$git clone https://github.com/annaozola/pyhabits
$cd pyhabits
$pip install pdfkit
# optional: install wkhtmltopdf for PDF export
$python pyhabits.py

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