![](https://private-user-images.githubusercontent.com/151896883/337520041-9324d27a-9ef9-4a0c-9e02-f74876ce36f9.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1NDM1NDcsIm5iZiI6MTcxOTU0MzI0NywicGF0aCI6Ii8xNTE4OTY4ODMvMzM3NTIwMDQxLTkzMjRkMjdhLTllZjktNGEwYy05ZTAyLWY3NDg3NmNlMzZmOS5qcGc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjI4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyOFQwMjU0MDdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05OThmYWRjYWM4NDEzNDJlZjhlNmY3MDkwYjViYjI5NjMyNjYzMzc3OTdlY2IzNTFjM2Q1ZWI0NGMzMzExMTIxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.zA5sFWvgjf9JeglEGttMGgXbZUQRqsMj47xiuEsSL9Q)
A simple command-line task manager application written in Python. This project allows users to manage tasks by adding, updating, removing, and filtering tasks based on various criteria.
- ➕ Add Task: Add new tasks to the list.
- ❌ Remove Task: Remove tasks by their ID.
- 🔄 Update Task: Update task details such as description, priority, and deadline.
- 🔍 Get Task: Retrieve task details by their ID.
- 📈 Set Task Priority: Set the priority of a task.
- ⏰ Set Task Deadline: Set the deadline for a task.
- ✅ Mark Task as Completed: Mark tasks as completed.
- 📝 Set Task Description: Set or update the description of a task.
- 🔎 Search Tasks by Keyword: Search tasks by a keyword in their description.
- 📌 Filter Tasks by Priority: Filter tasks by their priority.
- 🚦 Filter Tasks by Status: Filter tasks by their completion status (completed or pending).
- 📆 Filter Tasks by Deadline: Filter tasks by their deadline.
- 🔢 Count Tasks: Get the total number of tasks.
- ☑️ Count Completed Tasks: Get the number of completed tasks.
- ⏳ Count Pending Tasks: Get the number of pending tasks.
- 📊 Generate Task Summary: Generate a summary report of all tasks.
- 💾 Save Tasks: Saves tasks to json file.
- 📥 Load Tasks: Loads saved tasks from file.
⤵️ Sort Tasks by Deadline: Sort tasks by their deadline.⤴️ Sort Tasks by Priority: Sort tasks by their priority.- 🆔 ID Validation: Ensure the id number is integer.
- 🔢 Priority Validation: Checks if the priority entered by user is one of "low","medium" or "high".
- ⏰ Deadline Validation: Checks the date format and if the date is not past.
- 📝 Description Validation: Checks if the description is not empty string.
- Python 3.x
- Clone the repository:
git clone https://github.com/yourusername/task-manager.git
cd task-manager
Run the main script to start the task manager:
python main.py
Follow the on-screen menu to perform various task management operations.
The task.py
module defines the Task
class, which represents a task in the task manager. It includes validation methods and conversion methods for task attributes.
The task_manager.py
module defines the TaskManager
class, which manages a list of tasks and provides methods to add, remove, update, filter, sort, and save/load tasks.
The main.py
script provides a command-line interface for interacting with the TaskManager
. It includes a menu for performing various task management operations.
add_task(task: Task) -> None
Adds a new task to the list.
More...
- Parameters:
- `task (Task)`: The task to be added.
remove_task(task_id: int) -> None
: Removes a task by its ID.
More...
- Parameters:
task_id
(int): The ID of the task to be removed.
update_task(task_id: int, updated_task: dict) -> None
: Updates an existing task.
More...
- Parameters:
task_id
(int): The ID of the task to be updated.updated_task
(dict): The updated task details.
get_task_by_id(task_id: int) -> Task
: Retrieves a task by its ID.
More...
- Parameters:
task_id
(int): The ID of the task to be retrieved.
save_tasks_to_file(file_path: str) -> None
: Saves the provided list of tasks to a specified file path.
More...
- Parameters:
file_path
(str): The path to the file where tasks will be saved.
load_tasks_from_file(file_path: str) -> None
: Loads the list of tasks from a specified file path.
More...
- Parameters:
- `file_path (str)`: The path to the file from which tasks will be loaded.
set_task_priority(task_id: int, priority: str) -> None
: Sets the priority of a task.
More...
- Parameters:
task_id
(int): The ID of the task to be updated.priority
(str): The new priority level.
set_task_deadline(task_id: int, deadline: str) -> None
: Sets the deadline for a task.
More...
- Parameters:
task_id
(int): The ID of the task to be updated.deadline
(str): The new deadline.
mark_task_as_completed(task_id: int)-> None
: Marks a task as completed.
More...
- Parameters:
task_id
(int): The ID of the task to be marked as completed.
set_task_description(task_id: int, description: str) -> None
: Sets the description for a task.
More...
- Parameters:
task_id
(int): The ID of the task to be updated.description
(str): The new description.
search_tasks_by_keyword(keyword: str) -> list
: Searches tasks by a keyword in the description.
More...
- Parameters:
keyword
(str): The keyword to search for.
filter_tasks_by_priority(priority: str) -> list
: Filters tasks by priority.
More...
- Parameters:
priority
(str): The priority level to filter by.
filter_tasks_by_status(status: str) -> list
: Filters tasks by their completion status.
More...
- Parameters:
status
(str): The completion status to filter by.
filter_tasks_by_deadline(deadline: str) -> list
: Filters tasks by their deadline.
More...
- Parameters:
deadline
(str): The deadline to filter by.
count_tasks() ->
: Returns the total number of tasks.
count_completed_tasks() -> int
: Returns the number of completed tasks.
count_pending_tasks() -> int
: Returns the number of pending tasks.
generate_task_summary() -> dict
: Generates a summary report of all tasks.
sort_tasks_by_deadline() -> None
: Sorts tasks by their deadline.
sort_tasks_by_priority()-> None
: Sorts tasks by their priority.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.