A command-line task manager with JSON file storage. Add, view, complete, and delete tasks β they persist between sessions. Built with Python 3 β no external dependencies.
- Add tasks with timestamps
- View pending and completed tasks separately
- Mark tasks as completed
- Delete individual tasks
- Clear all completed tasks at once
- JSON file storage (tasks survive program restart)
- Progress tracking (X/Y done)
- Auto ID re-numbering after deletion
# Make sure Python 3.8+ is installed
python --version
# Clone this repository
git clone https://github.com/YOUR-USERNAME/python-todo-list.git
cd python-todo-list
# Run the program
python todo.py==================================================
π PYTHON TO-DO LIST
Beginnersly.com β Python Projects
==================================================
π Menu: (0 pending)
1. Add Task
2. View All Tasks
3. Complete Task
4. Delete Task
5. Clear Completed
6. Exit
Choice (1-6): 1
π Task title: Learn Python basics
β
Added: "Learn Python basics"
Choice (1-6): 2
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π YOUR TO-DO LIST (1 tasks)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π΄ Pending:
[1] β¬ Learn Python basics (added 2026-06-15 14:30)
π Progress: 0/1 done
Tasks are saved automatically to tasks.json:
[
{
"id": 1,
"title": "Learn Python basics",
"done": true,
"created": "2026-06-15 14:30",
"completed": "2026-06-15 15:45"
},
{
"id": 2,
"title": "Build password generator",
"done": false,
"created": "2026-06-15 14:31",
"completed": null
}
]- JSON file read/write (
json.load(),json.dump()) - CRUD operations (Create, Read, Update, Delete)
- Lists and Dictionaries
datetimemodule for timestamps- Functions for code organization
- List comprehensions for filtering
- Error handling (
try/except)
python-todo-list/
βββ todo.py # Main source code
βββ tasks.json # Auto-generated data file
βββ README.md # This file
βββ .gitignore # Git ignore rules
βββ LICENSE # MIT License
- Add task priorities (High/Medium/Low)
- Add due dates with overdue alerts
- Add categories/tags
- Add search functionality
- Build web version with Flask
- Export to CSV/TXT
Full tutorial with explanation: Beginnersly.com β To-Do List CLI
MIT License β free to use, modify, and share.