How artyomturkoff/habit_tracker works
This is a Python command-line habit tracker. A user selects a CLI workflow to check off, view, create, or delete habits, or inspect analytics. Habit logic maintains daily/weekly completion state and streaks; SQLite persists habits and completion history. First-run initialization can seed predefined habits and sample history. The README documents an overall-longest-streak report; source excerpts are partial, so uncertain internal wiring for that report is omitted.
Main entry points: main.py Command-line app · predefined_habits.py Predefined sample data · sqlitedb.py SQLite storage · habit.py Habit state and streaks
Components 7
CLI workflows
- Command-line app
main.py - Habit workflows
main.py
Habit domain
- Habit state and streaks
model/habit.py
Analytics
- Habit analytics
analytics/analytics.py
Persistence and seed data
- SQLite storage
database/sqlitedb.py - Predefined sample data
data/predefined_habits.py
Other components
- CLI user
Connections 9
- CLI user → Command-line app: chooses workflow
- Command-line app → Habit workflows: dispatches
- Habit workflows → SQLite storage: loads and saves
- Habit workflows → Habit state and streaks: checks off
- Habit workflows → Habit analytics: requests reports
- Command-line app → SQLite storage: initializes database
- Command-line app → Predefined sample data: loads on first run
- Predefined sample data → Habit state and streaks: creates sample habits
- Predefined sample data → SQLite storage: saves sample history