No description
  • Python 60.4%
  • Jupyter Notebook 39.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-03-03 16:22:10 +01:00
.gitignore .gitignore: ignore pickle files 2024-03-03 16:14:03 +01:00
example.ipynb Add instructions to README 2024-03-03 16:22:10 +01:00
README.md Add instructions to README 2024-03-03 16:22:10 +01:00
test_todos.py todos: add persistence with a pickle file 2024-03-03 16:13:08 +01:00
todos.py todos: add persistence with a pickle file 2024-03-03 16:13:08 +01:00

Todo List Command Line Kata

Goal: practice converting notebooks to command line interfaces

Specification

Each task is made of

  • A description
  • A number that identifies it
  • A status "done" or "to do"

The TasksManager implements a few methods to add, update and remove tasks from the list.

Instructions

Write a CLI so that you can use the task manager from the command line, like this:

Step 1

Add a cli using argparse that only shows the list of tasks:

$ task-manager

Step 2

Add sub-parsers so that you can use task-manager with a sub-command, like this argparse

$ task-manager list                          # List all tasks
$ task-manager add "Learn how to make CLIS"  # Add a new task
$ task-manager complete-task --number=1      # Mark task number 1 as done
$ task-manager undo-task --number=1          # Mark task number 2 as not done
$ taks-manger delete-task --number=1         # Delete task number 1

Make sure to call TaskManager.save_tasks() at the end of each command

Step 3

By default, tasks are load and saved from a file named tasks.pickle - and the possibility to set the file path from the command line