Video Demo: link
Program Description
The provided Python program is a task management system that allows users to create, manage, and track their tasks. It uses SQLite for data storage and manipulation, and incorporates a command-line interface for interaction. Below is a detailed description of the program's key components and functionalities:
-
Libraries Used:
tabulate
: This library is used for formatting data in tabular form, making it easier for users to read and interact with the tasks.
-
Classes:
task_manager
: This class represents a user's task management system. It contains methods for adding, removing, rescheduling, and marking tasks as done. It also provides statistics on the user's tasks.
-
Attributes of
task_manager
:name
andpassword
: These attributes represent the username and password associated with the user's task manager.tasks
: This is a list of dictionaries, where each dictionary represents a task. Each task contains information about the task name, priority, and due date.completed_tasks
andpending_tasks
: These attributes keep track of the number of completed and pending tasks respectively.db_file_name
: This attribute holds the name of the SQLite database file associated with the user.
-
Methods of
task_manager
:__init__(self, name, password)
: Initializes a new instance oftask_manager
. It checks if a database file for the user already exists and loads tasks if available.__str__(self)
: Returns a formatted string representation of the tasks, sorted by priority.add_task(self, task)
: Adds a new task to the user's task list and updates the database.remove_task(self, task_name)
: Removes a task from the user's task list and updates the database.reschedule_task(self, task_name, new_due_date)
: Updates the due date of a task and modifies the database accordingly.mark_as_done(self, task)
: Marks a task as done, updates task counts, and removes it from the task list.stats
: Provides statistics on the user's tasks, including the number of completed and pending tasks.
-
Global Variables:
users
: A list to store user information.classes
: A dictionary that maps usernames to their respectivetask_manager
instances.current_user
: A string representing the currently logged-in user.
-
Authentication and User Management:
authenticator()
: Authenticates a user by verifying their username and password against the stored information in the database.option_menu_user()
: Displays the menu for user-related operations and returns the chosen option.add_user()
: Adds a new user, creates a correspondingtask_manager
instance, and stores the user's information in the database.remove_user()
: Removes a user, deletes their database file, and updates the user list.
-
Task Management:
option_menu_task_manager()
: Displays the menu for task-related operations and returns the chosen option.- Methods like
add_task()
,remove_task()
,mark_as_done()
,reschedule_task()
,display_stats()
, anddisplay_all_tasks()
perform various task management operations.
-
Unused Functions:
unused_fun(i)
: A placeholder function.unused_fun1(j)
: Another placeholder function.
-
Execution:
- The program's main entry point is the
main()
function. It initiates the user interaction by presenting options for creating a new user, removing a user, or signing in to an existing account.
- The program's main entry point is the
-
Error Handling:
- The program includes basic error handling for incorrect inputs (e.g., ValueError) and password validation.
-
Database Handling:
- The program uses SQLite to create and manage databases for users and their respective tasks.
-
Exiting the Program:
- If an invalid option is selected, the program exits with a message thanking the user for visiting.
Overall, this program provides a flexible and organized platform for users to manage their tasks efficiently, with persistent data storage using SQLite. It employs a command-line interface, making it accessible and easy to use for a wide range of users.
1. Add user
2. Remove user
3. Login to existing account
1. Add task
2. Remove task
3. Reschedule task
4. Mark task as done
5. Display every task
6. Display stats for tasks completed and tasks pending