A command-line habit tracker is a simple yet powerful way to track daily habits and maintain consistency over time. Below is a Python-based command-line habit tracker using a local JSON file for storage. This script supports adding, viewing, completing, and deleting habits.
Features
-
Add new habits
-
Mark habits as completed for the day
-
View status of habits
-
Delete habits
-
Store data persistently in a JSON file
Requirements
-
Python 3.x
-
No external libraries needed (uses built-in modules)
Code: habit_tracker.py
How to Use
-
Save the code in a file named
habit_tracker.py
-
Run it in terminal:
-
Follow the interactive menu to manage your habits.
This tracker is designed for local use. If you want to extend its functionality later, consider adding:
-
Weekly/monthly stats
-
Notifications/reminders
-
Integration with Google Sheets or a database
-
A web or GUI interface
Let me know if you’d like an extended version with any of these features.
Leave a Reply