0% found this document useful (0 votes)
16 views24 pages

Cs Akshita Inves Final

Investigatory file CS Class 12 2024-25

Uploaded by

Akshita Dubey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views24 pages

Cs Akshita Inves Final

Investigatory file CS Class 12 2024-25

Uploaded by

Akshita Dubey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

PM SHRI KENDRIYA VIDYALAYA

NO. 2 AFS GWALIOR

INVESTIGATORY PROJECT
COMPUTER SCIENCE
CLASS XII (2024-25)

Name: Akshita Dubey


Roll no: 12107
Topic: PROUCTIVITY TRACKING AND TASK
MANAGEMENT
INDEX

Serial Contents
No.

1 Acknowledgement
2 Certificate
3 System Requirements
4 Introduction
5 Python Source Code
6 Outputs
7 References
Acknowledgement
I would like to extend my sincere and heartfelt
obligation towards all those who have helped me in
making this project. Without their active guidance,
help, cooperation and encouragement, I would not
have been able to present the project on time.

I am extremely thankful and pay my sincere gratitude


to my teacher Mrs. Shalini Gupta for her valuable
guidance and support for completion this project.

I extend my sincere gratitude to my Principal Mr.


Sanjeev Kumar Sambariya for the moral
support extended during tenure of this project.

I also acknowledge with a deep sense of reverence, my


gratitude towards my parents, other faculty members
of the school and friends for their valuable
suggestions given to me in completing the project.

Name Signature
Certificate
This is to certify that the project work
titled Productivity tracking and
task management is the bonafide
work of Akshita Dubey of Class XII A
of PM SHRI Kendriya Vidyalaya No. 2
AFS Gwalior as a part of Computer
Science Project work for class XII
AISSCE,2024-25.
The above mentioned project work has
been completed under my guidance
during the academic year 2024-2025.

Signature of Internal Signature of External

Signature of Principal
SYSTEM REQUIREMENTS

1. Python Installation:
o Version: Python 3.6 or above.

o Ensure Python is added to your system's PATH.

2. Required Libraries:
o os (Standard Library: No additional installation

required).
o datetime (Standard Library: No additional installation

required).
3. Text File Permissions:
o Read/Write Access: Ensure the program has

permission to read from and write to the following files:


 task_list.txt (Stores tasks).

 productivity_report.txt (Stores generated

productivity reports).
4. Hardware Requirements:
o Minimum RAM: 2GB.

o Disk Space: At least 100MB of free storage for saving

task files.
5. Operating System Compatibility:
o Windows, macOS, or Linux (Any OS that supports

Python 3.6+).
6. Optional:
o A text editor or IDE (e.g., VS Code, PyCharm) for

modifying the code or debugging.


INTRODUCTION

In a world where life moves faster than ever, many


people struggle to keep up with their responsibilities.
Being unproductive and not managing tasks efficiently
has become a common problem that leads to missed
opportunities, stress, and poor time management.
Research shows that using organized task management
systems can improve productivity by up to 25%, and
surveys reveal that 70% of people feel less stressed
and more focused when they use to-do lists.
I created this project to address this problem and help
people stay on top of their tasks with a clear, structured
system. Whether you’re a student balancing school and
life, a professional managing work, or someone seeking
more control over their time, this program provides all
the features you need, from deadline reminders to
productivity reports.
To-do lists reduce procrastination, build motivation,
and ease the mental load of daily responsibilities. In a
world that demands so much, this tool offers a practical
way to make life more organized, productive, and stress-
free.
import os # For file handling (reading and writing tasks to files)
import datetime # To log time of actions

# Define the file paths where tasks and reports will be saved
TASK_FILE = "task_list.txt" # Tasks will be stored in this file
REPORT_FILE = "productivity_report.txt" # Productivity reports will
be stored here

# Function to read tasks from the file


def read_tasks():
tasks = [] # Empty list to hold all tasks
if os.path.exists(TASK_FILE): # Check if the task file exists
with open(TASK_FILE, "r") as file: # Open the task file in read
mode
for line in file: # Loop through each line in the file
task_data = line.strip().split(", ") # Split the line into task
details
task = { # Create a dictionary for each task
"title": task_data[0], # Task title (name of task)
"deadline": task_data[1], # Task deadline
"priority": task_data[2], # Task priority (High, Medium,
Low)
"status": task_data[3], # Task status
(Incomplete/Complete)
"category": task_data[4], # Task category (e.g., Work,
School)
"time_spent": float(task_data[5]), # Time spent on task
}
tasks.append(task) # Add this task to the list of tasks
return tasks # Return the list of tasks

# Function to write tasks to the file


def write_tasks(tasks):
with open(TASK_FILE, "w") as file: # Open the task file in write
mode
for task in tasks: # Loop through all tasks
file.write(f"{task['title']}, {task['deadline']}, {task['priority']},
{task['status']}, {task['category']}, {task['time_spent']}\n") # Save
each task

# Function to add a new task


def add_task():
print("\n--- Add a New Task ---")
title = input("Enter the task title: ").strip() # Ask user for the task
name
deadline = input("Enter the deadline (YYYY-MM-DD): ").strip() #
Ask for the deadline
priority = input("Enter priority (High, Medium, Low): ").strip() #
Ask for priority
category = input("Enter category (Work, School, Personal): ").strip()
# Ask for task category
status = "Incomplete" # Default status is Incomplete
time_spent = 0.0 # Start with no time spent on new tasks

tasks = read_tasks() # Get all existing tasks


tasks.append({ # Add the new task to the task list
"title": title,
"deadline": deadline,
"priority": priority,
"status": status,
"category": category,
"time_spent": time_spent,
})

write_tasks(tasks) # Write all tasks back to the file


print("Task added successfully!") # Notify user that task was added

# Function to view all tasks


def view_tasks():
print("\n--- Task List ---")
tasks = read_tasks() # Read tasks from the file
if not tasks: # Check if there are no tasks
print("No tasks found.")
return # Exit if no tasks

# Print each task's details


for i, task in enumerate(tasks, start=1): # Loop through tasks and
display them
print(f"{i}. {task['title']} (Deadline: {task['deadline']}, Priority:
{task['priority']}, Status: {task['status']}, Category: {task['category']},
Time Spent: {task['time_spent']} hours)")

# Function to mark a task as complete


def mark_task_complete():
print("\n--- Mark Task as Complete ---")
view_tasks() # Show all tasks
tasks = read_tasks() # Get all tasks from file
if not tasks: # If no tasks exist, return
return

try:
task_number = int(input("Enter task number to mark as complete:
")) - 1 # Ask for task number
if 0 <= task_number < len(tasks): # Check if the number is valid
tasks[task_number]["status"] = "Complete" # Change the task
status to "Complete"
write_tasks(tasks) # Save the updated task list
print("Task marked as complete!") # Notify user
else:
print("Invalid task number.") # Invalid task number
except ValueError: # If the user does not enter a valid number
print("Please enter a valid number.")

# Function to delete a task


def delete_task():
print("\n--- Delete a Task ---")
view_tasks() # Show all tasks
tasks = read_tasks() # Get all tasks
if not tasks: # If no tasks exist, return
return

try:
task_number = int(input("Enter task number to delete: ")) - 1 #
Ask for task number
if 0 <= task_number < len(tasks): # Check if task number is valid
deleted_task = tasks.pop(task_number) # Remove task from
list
write_tasks(tasks) # Save the updated task list
print(f"Task '{deleted_task['title']}' deleted successfully!") #
Notify user
else:
print("Invalid task number.") # Invalid task number
except ValueError: # If the user enters an invalid value
print("Please enter a valid number.")

# Function to remind about tasks with upcoming deadlines


def deadline_reminder():
print("\n--- Deadline Reminder ---")
tasks = read_tasks() # Get all tasks
if not tasks: # If there are no tasks, return
print("No tasks to check deadlines for.")
return

today = datetime.datetime.today() # Get the current date


soon_tasks = [] # List to hold tasks with upcoming deadlines

for task in tasks:


task_deadline = datetime.datetime.strptime(task["deadline"],
"%Y-%m-%d") # Convert deadline to datetime
if 0 <= (task_deadline - today).days <= 3: # Check if deadline is
within the next 3 days
soon_tasks.append(task) # Add task to list of tasks due soon
if soon_tasks:
print("Tasks due soon:")
for task in soon_tasks: # Display tasks that are due soon
print(f" - {task['title']} (Deadline: {task['deadline']}, Priority:
{task['priority']})")
else:
print("No tasks are due within the next 3 days.") # No tasks are
due soon

# Function to export tasks to a new file


def export_task_list():
output_file = input("\nEnter the name of the file to export tasks to
(e.g., tasks_export.txt): ").strip() # Ask for filename
tasks = read_tasks() # Get all tasks
if not tasks: # If no tasks exist, return
print("No tasks to export.")
return

with open(output_file, "w") as file: # Open the new file to save


tasks
for task in tasks: # Loop through tasks and save them
file.write(f"{task['title']}, {task['deadline']}, {task['priority']},
{task['status']}, {task['category']}, {task['time_spent']}\n")
print(f"Task list exported to {output_file} successfully!") # Notify
user

# Function to generate a productivity report


def generate_report():
print("\n--- Productivity Report ---")
tasks = read_tasks() # Get all tasks
if not tasks: # If no tasks exist, return
print("No tasks to generate a report.")
return

categories = {} # Dictionary to store category-wise statistics


completed_tasks = 0 # To count completed tasks
total_time_spent = 0 # To count total time spent on tasks

for task in tasks:


if task["category"] not in categories: # If category is not in
dictionary, add it
categories[task["category"]] = {"tasks": 0, "completed": 0}
categories[task["category"]]["tasks"] += 1 # Increment total tasks
in category
if task["status"] == "Complete": # If the task is completed
completed_tasks += 1 # Increment completed tasks count
categories[task["category"]]["completed"] += 1 # Increment
completed tasks in category
total_time_spent += task["time_spent"] # Add time spent to total

print(f"Total Tasks: {len(tasks)}") # Print total number of tasks


print(f"Completed Tasks: {completed_tasks}") # Print completed
tasks count
print(f"Total Time Spent: {total_time_spent} hours\n") # Print total
time spent

for category, stats in categories.items(): # Print category-wise


statistics
print(f"Category: {category}")
print(f" - Total Tasks: {stats['tasks']}")
print(f" - Completed: {stats['completed']}")

# Function to display the main menu


def display_menu():
while True:
print("\n--- Productivity Tracking & Task Management ---")
print("1. View Tasks")
print("2. Add Task")
print("3. Mark Task as Complete")
print("4. Delete Task")
print("5. Deadline Reminder")
print("6. Export Task List")
print("7. Generate Productivity Report")
print("8. View Tasks by Category")
print("9. Exit")

choice = input("Enter your choice (1-9): ").strip() # Ask user for


menu choice

if choice == "1":
view_tasks() # View all tasks
elif choice == "2":
add_task() # Add new task
elif choice == "3":
mark_task_complete() # Mark task as complete
elif choice == "4":
delete_task() # Delete a task
elif choice == "5":
deadline_reminder() # Show tasks due soon
elif choice == "6":
export_task_list() # Export tasks to a file
elif choice == "7":
generate_report() # Generate productivity report
elif choice == "8":
view_tasks_by_category() # View tasks grouped by category
elif choice == "9":
print("Exiting the program. Goodbye!") # Exit the program
break # Exit the while loop
else:
print("Invalid choice. Please try again.") # Invalid menu choice

# Function to view tasks by category


def view_tasks_by_category():
print("\n--- View Tasks by Category ---")
tasks = read_tasks() # Get all tasks
if not tasks: # If there are no tasks, return
print("No tasks found.")
return

categories = {} # Dictionary to store tasks by category


for task in tasks:
if task["category"] not in categories: # If category not found, add
it
categories[task["category"]] = []
categories[task["category"]].append(task) # Add task to
appropriate category
for category, category_tasks in categories.items():
print(f"\nCategory: {category}")
for task in category_tasks: # Display tasks in each category
print(f" - {task['title']} (Deadline: {task['deadline']}, Priority:
{task['priority']}, Status: {task['status']}, Time Spent:
{task['time_spent']} hours)")

# Main program entry point


if __name__ == "__main__":
print("Welcome to the Productivity Tracking and Task Management
System!") # Greet user
display_menu() # Show the menu
REFERENCES

1. Wikipedia
https://www.wikipedia.org/

2. Python
https://www.python.org/
3. MySQL
https://www.mysql.com/
4. 11th and 12th Computer
Science Arihant Books

You might also like