TaskManager Class

class to_do_list_project.task_manager.TaskManager(db: SQLiteDB | None = None)

A management system for tasks using an SQLite database.

This class provides methods to handle the CRUD operations and other utility functionalities related to tasks.

add_task(name: str, description: str, due_date: datetime, assignee: List[str], status: TaskStatus = TaskStatus.IN_PROGRESS, priority: TaskPriority = TaskPriority.MEDIUM, categories: List[str] | None = None) int

Add task to database.

complete_task(task_id: int) None

Mark a task as complete.

Raises:

TaskNotFoundError: If the task is not found.

get_all_tasks() List[tuple]

Get all the tasks of database.

get_task_by_id(task_id: int) Task

List all the tasks of database.

load_tasks_from_db() List[Task]

Load all tasks from database.

modify_task(task_id: int, new_name: str, new_description: str, new_due_date: datetime, new_assignee: List[str]) None

Modify an existing task’s attributes.

Args:

task_id (int): The ID of the task to modify. new_name (str, optional): New name for the task. new_description (str, optional): New description for the task. new_due_date (datetime, optional): New due date for the task. new_assignee (List[str], optional): New assignees for the task. new_status (TaskStatus, optional): New status for the task. new_priority (TaskPriority, optional): New priority for the task. new_categories (List[str], optional): New categories for the task.

remove_task(task_id: int) None

Remove task from database.