🛠
Practice Projects · ★★
Lists · Dicts · Functions · JSON persistence
Project 5 — To-Do List App
Build a full-featured to-do list with priorities, due dates, categories, and JSON file persistence.
listdictJSONpersistenceCLI
Duration
⏱ 2 hours
Level
📊 Intermediate Applied
Prerequisite
🎯 Basic Week 10
OUTCOME
A feature-complete to-do app with file persistence
What you'll learn
- 1Store tasks as dicts with id, title, priority, due_date, category
- 2Implement CRUD + filter + sort commands
- 3Persist to JSON on every write
- 4Display tasks in a clean tabular format
Commands
- add <title> [--priority high|medium|low] [--due YYYY-MM-DD] [--cat <category>]
- list [--filter done|pending] [--sort priority|due|id]
- done <id> — mark complete
- delete <id>
- search <keyword>
- stats — show counts by priority/category
Sample Output
text
> list --sort priority
ID P Due Category Title
3 H 2024-05-20 Work Write report
1 M 2024-05-22 Personal Buy groceries
2 L — Chores Clean garage
Done: 0/3📝 Exercises
Try them yourself first, then open the solution to compare.
Exercise 1
Build the to-do app
Goal: Implement all commands with JSON persistence.
Requirements
- All CRUD operations
- Filter and sort options
- JSON file persistence
- stats command
Grading
- · CRUD works — 40%
- · Filter/sort — 20%
- · Persistence — 25%
- · Stats — 15%
Example code / lecture materials
All lecture materials and example code are openly available on GitHub.
View on GitHub ↗