This is a simple CLI tool built with Python and Click for managing a task list.
To install the dependencies, run:
pip install click
You can set the task file format to either JSON or CSV by using the --format
option. The default format is JSON.
python task_format.py --format json # Use JSON format
python task_format.py --format csv # Use CSV format
To add a task to the list:
python task_format.py add "Your task description"
To remove a task by its ID:
python task_format.py remove TASK_ID
To list all tasks:
python task_format.py list
To edit a task description by its ID:
python task_format.py edit TASK_ID "New task description"
To mark a task as completed or uncompleted by its ID:
ёpython task_format.py mark TASK_ID --uncompleted # Mark as uncompleted
To filter tasks by their status:
python task_format.py filter --completed # Show only completed tasks
python task_format.py filter --uncompleted # Show only uncompleted tasks
To search for tasks by a keyword:
python task_format.py search "keyword"
To clear all tasks:
python task_format.py clear
To clear all completed tasks:
python task_format.py clear_completed
python task_format.py add "Buy milk"
python task_format.py add "Walk the dog"
python task_format.py add "Write report"
python task_format.py list
Output:
0: ❌ Buy milk
1: ❌ Walk the dog
2: ❌ Write report
python task_format.py mark 0 --completed
python task_format.py filter --completed
Output:
0: ✔️ Buy milk
python task_format.py search "dog"
Output:
1: ❌ Walk the dog
python task_format.py clear_completed
python task_format.py list
Output:
1: ❌ Walk the dog
2: ❌ Write report
- JSON
- CSV