Associate tasks to a category, being able to establish its state, name, due date and description.
This project was built as a learning exercise to practice OOP in Python, along with other programming techniques.
- Create categories to organize tasks.
- Add tasks to a category, with a title, due date, and optional description.
- View all tasks in the system, grouped by category.
- Mark tasks as completed.
- Filter and view only pending tasks.
- Input validation: the program keeps asking until it receives a valid value.
| Data Type | Attributes / Variables | Description |
|---|---|---|
| Input Data | choice (str), category_name (str), task_name (str), due_date (str), description (str), status (str) |
Raw inputs collected via CLI user prompts |
| Output Data | Console UI Render | The script doesn't generate any variable to show, it just saves variables and shows them in a certain format |
Task(task.py): Change state and order the task features.Category(category.py): Save a list of tasks (add, remove), create a list of all pending tasks and order the tasks under its name.Manager(manager.py): Save a dictionary of categories, controls task saving, recognises all pending tasks and orders everything.
- Ask for the category name.
- The
Managerclass checks if the category already exists.-
Exists: Shows an error message
$\rightarrow$ Goes back to step 1. -
Does not exist: Adds the category to the
Managerdictionary of categories$\rightarrow$ Goes back to step 1.
-
Exists: Shows an error message
- The
Managerclass checks if there are categories.-
No categories: Shows an error message
$\rightarrow$ Goes back to step 1. - Categories exist: Shows the available ones.
-
No categories: Shows an error message
- Ask the user to choose one, and ask for the task features (title, due date and description — optional).
- The
Managerclass checks if the category exists.-
Does not exist: Shows an error message
$\rightarrow$ Goes back to step 1. -
Exists: Adds the task to the category list of tasks
$\rightarrow$ Goes back to step 1.
-
Does not exist: Shows an error message
- Checks if the
Managerclass has any category.-
No categories: Shows an error message
$\rightarrow$ Goes back to step 1. -
At least one category: Shows all tasks saved in each of the categories own list
$\rightarrow$ Goes back to step 1.
-
No categories: Shows an error message
- Checks if the
Managerclass has any category.-
No categories: Shows an error message
$\rightarrow$ Goes back to step 1. - At least one category: Shows all categories, and asks the user to choose one.
-
No categories: Shows an error message
- Check selected category:
-
Category doesn't exist: Shows an error message
$\rightarrow$ Goes back to step 1. -
Category exists but has no tasks: Shows an error message
$\rightarrow$ Goes back to step 1. - Category has tasks: Shows all tasks saved in the category class list.
-
Category doesn't exist: Shows an error message
- Ask the user to input the number of the task that wants to mark as completed.
-
ValueErrororIndexError: Shows an error message$\rightarrow$ Goes back to step 1. -
Correct input: The chosen task state changes to completed
$\rightarrow$ Goes back to step 1.
-
- The
Managerclass returns a list with all tasks from the categories that it has saved in its dictionary. - Check returned list:
-
Empty list: Shows an error message
$\rightarrow$ Goes back to step 1. -
Not empty: Prints all the tasks that the list contains
$\rightarrow$ Goes back to step 1.
-
Empty list: Shows an error message
- Prints
"Goodbye!"and exits the program (doesn't move to step 3).
main.py— Entry point of the program: menu, user interaction, and input validation.manager.py—Managerclass, which coordinates categories and tasks.category.py—Categoryclass, which groups a list of tasks.task.py—Taskclass, representing a single task.
Requires Python 3. From the project folder:
python main.py