The Eisenhower Matrix is a great tool for time management and improve your productivity. It is often used in IT projects teams for prioritize tasks.
Bob is a beginner Codecooler. He is a good self-learner, but he has a problem to focus on the only one thing in one moment. That's the reason that he sometimes feels lost in his job. Please help him to improve his efficiency and implement for him Eisenhower Matrix Application. He precised his expectations the user story.
- Important & urgent: Implement all modules described in a specification.
- Important & not urgent: Adjust it for user needs, based on the user story.
- Not important & urgent: Fill up the specification (use markdown syntax).
- Not important & not urgent: Add some extra features.
- As a user I would like to choose a status of shown TODO items:
-
urgent & important items
-
not urgent & important items
-
urgent & not important items
-
not urgent & not important items
Urgent means that there's 3 days (72 hours) to deadline at least.
-
As a user I would like to see a list TODO items sorted decreasing by deadline from chosen matrix's quarter with its details.
-
As a user I would like to see a deadline formatted to day-month. I use matrix for the 2017 year.
-
As a user I would like to add an item with its deadline and priority, which is automatically assign to a properly quarter.
-
As a user I would like to mark TODO item by cross if it's done.
-
As a user I would like to undo marking a TODO item.
-
As a user I would like to remove a chosen TODO item.
-
As a user I would like to archive TODO items - remove all done items.
-
As a user I would like to keep all my TODO items in a .csv files.
-
As a user I would like to automatically archive all done tasks before save items and quit the application.
-
As a user I would like to see a whole Eisenhower matrix (every quarter with its items).
- As a user I would like to see colored (only unmarked) todo_items:
- green: if the deadline is coming far than 3 days
- orange: if deadline is coming in the next 3 days
- red: if deadline is crossed
- As a user I would like to see a matrix formatted to the following table.
| URGENT | NOT URGENT |
--|--------------------------------|--------------------------------|--
| 1. [ ] 9-6 go to the doctor | |
| 2. [x] 11-6 submit assignment | |
I | | |
M | | |
P | | |
O | | |
R | | |
T | | |
A | | |
N | | |
T | | |
| | |
| | |
--|--------------------------------|--------------------------------|--
N | 1. [ ] 14-6 buy a ticket | 1. [x] 30-5 House of Cards |
O | | |
T | | |
| | |
I | | |
M | | |
P | | |
O | | |
R | | |
T | | |
A | | |
N | | |
T | | |
--|--------------------------------|--------------------------------|--
-
Implement all modules described in a specification.
-
Implement the main.py module and fulfill its specification.
-
You are allowed to implement your own custom functions and modules. Remember about clean code.
-
Remember about comments and docstrings.
-
All tests must pass.
-
Please don't change a file todo_items_read_test.csv! It's important for passing tests.
-
Your program should fulfill cases described in the user story.
-
Use module datetime for time variables and operations -> https://docs.python.org/3/library/datetime.html
-
Program should be based on the Object Oriented Programming paradigm
-
Remember about proper constructors - not all attributes object are assign by a parameter!
-
Plan your task in Eisenhower matrix. First of all focus on the implement required class (and its instance methods). Then think about usefulness.
-
Please fill up specification in this file if you implemented more functions. Use markdown syntaxes.
Fuctions
-
main()
-
handle_menu()
Function prints main menu
-
choose_and_start_option(matrix)
Function gets input from user and runs proper function
This is the file containing a TODO item logic.
Instance Attributes
-
title
- data: string
- description: title of todo_item
-
deadline
- data: Datetime object
- description: deadline of todo_item, year is always set to 2017
-
is_done
- data: bool
- description: contains True if TODO item is done, otherwise contains False. Default value is False
Instance methods
-
Constructs an ToDoItem object Raises ValueError if type of any argument is incorrect
-
mark(self)
Sets the object's * is_done * attribute to True
-
unmark(self)
Sets the object's * is_done * attribute to False
-
__str__(self)
Returns a formatted string with details about todo_item. Format of deadline is 'day-month'
Expecting output for example done item:
[x] 12-6 submit assignment
Expecting output for example undone item:
[ ] 28-6 submit assignment
-
color__str__(self)
Returns a formatted colored string with details about todo_item. Format of deadline is 'day-month' Colors of strings (only for undone tasks):
- green: if the deadline is coming far than 3 days
- orange: if deadline is coming in the next 3 days
- red: if deadline is crossed
This is the file containing a logic of the Eisenhower TODO quarter.
Instance Attributes
todo_items
- data: list
- description: list of TodoItem objects
width
- data: int
- description: width of quarter
height
- height: int
- description: height of quarter
Instance methods
-
Constructs a ToDoQuarter object
-
sort_items(self)
Sorts a todo_items list decreasing by attribute deadline.
-
add_item(self, title, deadline)
Append TodoItem object to attribute todo_items sorted decreasing by deadline. Raises TypeError if an argument deadline is not an instance of Datetime class.
-
remove_item(self, index)
Removes TodoItem object from index of attribute todo_items.
-
archive_items(self)
Removes all TodoItem objects with a parameter is_done set to True from attribute todo_items.
-
get_item(self, index)
Returns TodoItem object from index of attribute todo_items. Raises IndexError if an argument index is out of range attribute todo_items.
-
__str__(self)
Returns a formatted string of todo_items sorted decreasing by deadline. There is an expecting output:
1. [ ] 9-6 go to the doctor 2. [x] 11-6 submit assignment
Hint: use instance method str() from class TodoItem
-
color__str__(self)
Returns a formatted colored string of todo_items sorted decreasing by deadline. Colors of strings (only for undone tasks):
- green: if the deadline is coming far than 3 days
- orange: if deadline is coming in the next 3 days
- red: if deadline is crossed
-
calculate_quarter_size(self)
returns height and width of quarter
This is the file containing the logic of the Eisenhower TODO matrix.
Instance Attributes
-
todo_quarters
-
data: dictionary
-
description: contains TodoQuarter objects
key: string - status of todo_quarter, value: TodoQuarter object
possible status of TODO quarter: - 'IU' means that todo_quarter contains important todo_items & urgent - 'IN' means that todo_quarter contains important todo_items & not urgent - 'NU' means that todo_quarter contains not important todo_items & urgent - 'NN' means that todo_quarter contains not important & not urgent todo_items
-
-
columns_width
- data: int
- description: width of matrix columns
-
columns_height
- data: int
- description: height of matrix rows
Instance methods
-
Constructs a TodoMatrix object with all possible quarters.
-
get_quarter(self, status)
Returns a chosen TodoQuarter object from the attribute todo_quarters. Status should be one of the possible statuses ('IU', 'IN', 'NU', 'NN').
-
add_item(self, title, deadline, is_important=False)
Append a TodoQuarterItem object to attribute todo_items in the properly TodoQuarter object. Raises TypeError if an argument deadline is not an instance of class Datetime.
-
add_items_from_file(self, file_name)
Reads data from file_name.csv file and append TodoItem objects to attributes todo_items in the properly TodoQuarter objects. Raises FileNotFoundError if a file doesn't exist. Every item is written to a separate line in the following format:
title|day-month|is_important
If is_important is equal to False then last element is en empty string. Otherwise the last element is an arbitrary string If the last element of line is an empty string, is_important is equal to False - it means that the item should be assign to a not important TODO quarter. Otherwise item should be assign to an important TODO quarter.
-
save_items_to_file(self, file_name)
Writes all details about TODO items to file_name.csv file Every item is written to a separate line in the following format:
title|day-month|is_important
If is_important contains False then the last element of line should be an empty string. Otherwise last element is an arbitrary string.
-
archive_items(self)
Removes all TodoItem objects with a parameter is_done set to True from list todo_items in every element of the attribute todo_quarters
-
__str__(self)
Returns all elements of attribute todo_quarters formatted to string.
Fuctions
-
add_item(matrix)
Function gets input from user and adds item to the matrix
-
choose_quarter(matrix)
Function gets input from user and chooses the proper quarter of matrix
-
choose_item(chosen_quarter)
Function gets input from user and chooses the proper item of given matrix quarter
-
choose_item_index()
Function gets input from user and returns index of item
-
mark_item(matrix)
Function marks item as done
-
unmark_item(matrix)
Function marks item as undone
-
remove_item(matrix)
Function removes item from quarter list of items
Fuctions
-
choose_quarter_name(deadline, is_important)
Function chooses quarter of matrix
-
read_file(file_name)
Function reads file content
-
prepare_items_to_add(item_list)
Function prepares data format for adding new TodoItem objects
-
create_list_to_save(matrix)
Function creates data of all TodoItems to export to the file
-
prepare_items_to_save(list_to_save)
Function prepares list of strings to save to the file
-
prepare_titles_row(columns_width)
Function prepares title row of matrix to print
-
prepare_border_row(columns_width)
Function prepares border row of matrix to print
-
prepare_important_rows(str_list, columns_width, rows_height, row_name)
Function prepares data rows of matrix to print
-
print_error_message(message)
Function prints red error message
-
choose_item_color(deadline, is_done)
Function chooses proper color