adding
, listing
, marking
, and clearing
tasks are defined here.
todo_data.json
priority
for new tasks is “medium”.created
field is always generated automatically.due
field is optional and can be left blank.Function | Description |
---|---|
load_tasks() | Load tasks from the JSON file |
save_tasks(tasks) | Save tasks to the JSON file |
add_task(text) | Add a new task with optional priority and due date |
list_tasks() | Return all existing tasks |
complete_task(id) | Mark a task as completed by ID |
delete_task(id) | Delete a task by ID |
edit_task(...) | Edit an existing task’s text, priority, due date or tags |
clear_tasks() | Remove all tasks from the list |
Section | Responsibility | Functions |
---|---|---|
🔄 File operations | Load and save task data in JSON format | load_tasks , save_tasks |
➕ Task creation | Add new tasks with automatic ID and status | add_task |
📄 Task reading | Read and return task data | list_tasks |
✅ Task updates | Modify the status of tasks | complete_task |
✅ Task edit | Modify the status or content of tasks | complete_task , edit_task |
❌ Task deletion | Remove tasks individually or all at once | delete_task , clear_tasks |