Project File Cs - Aditi
Project File Cs - Aditi
PROJECT REPORT ON
PLANNER
SUBMITTED BY:
ADITI SAKPAL
CLASS: XII SCIENCE
INDEX
1 Certificate 1
2 Acknowledgement 2
3 Declaration 3
4 Introduction 4
5 Application 5
9 Source Code 9
10 Output Screenshots 19
11 Bibliography 26
CERTIFICATE
This is to certify that the Computer Science Project, entitled Planner, was done by Aditi
under my guidance and supervision. It is further certified that the work is original.
______________________ _____________________
Last but not the least, I would like to thank all those who had helped
directly or indirectly towards the completion of this project
DECLARATION
Aditi Sakpal
Student
XII-Science
INTRODUCTION
And due to this dilemma came the inspiration for this project.
This is simple to use and serves like an assignment record book and reminder for
assignment or self-appointed tasks.
APPLICATION
The user enters tasks (assignments etc.) which are then entered into table in
MySQL a database management system.
Thus, a total of eight (8) options are there for the user to generate queries and use
the program accordingly.
HARDWARE AND SOFTWARE REQUIREMENTS
Python
• Find the downloaded file on your file system and start the installer
• Keep a close eye on the multi-step installer and read the steps to complete the
installation
• Lastly, launch the installer to start the python command line
MySQL
.NET Framework
Network Software
FRONT-END AND BACK-END
Modules imported:
mysql.connector
calendar
datetime
data_entry_pend() - If it is past the due date entered is shifts into pend table
while being deleted in pend table.
data_entry_done() - enters tasks once done by user while deleting it from the task
table.
data_entry_done2() - enters tasks once done by user while deleting it from pend
table.
all_imp_task() - collects the value and shows the tasks which are important
"""
Computer Science Project
Developed by - Aditi Sakpal of XII-Science, The Kalyani School, Manjri
For - CBSE Senior Secondary Examination of Computer Science
Project Title - Planner
Purpose - To keep track of assignments/tasks. Automatically shifts
to pending if due date is crossed.
Inspired By - Unsystematic and lack of timely submissions due to
the pandemic
________________________________________________________________
Special requirements:
* mysql.connector
* tabulate
This script requires the above mentioned to be installed within the
python environment you are running this script in.
________________________________________________________________
"""
#Importing
import mysql.connector
import calendar
import datetime
from datetime import date
from tabulate import tabulate
#Connecting sql and python
mydb=mysql.connector.connect(host='localhost',user='root',passwd='password1
23')
print(mydb)
cursor=mydb.cursor()
#print(calendar.calendar(2020))
current_date = date.today()
#Add tasks
def data_entry_tasks():
"""Takes values inputted by used and inserts in table tasks"""
cursor.execute("use planner")
task_id=int(input("Enter the id of the task : "))
task_name=input("Enter the name of the task : ")
important=input("Enter important (yes/no) : ")
date=input("Enter date(YYYY-MM-DD): ")
try:
sql=("INSERT INTO tasks(t_id,t_name,t_date,important) VALUES
(%s,%s,%s,%s)",(task_id,task_name,date,important))
cursor.execute(*sql)
mydb.commit()
print("task entered")
except ( mysql.connector.Error) as err :
print("Error")
print(err)
def data_entry_done2():
'''
enters tasks once done by user while deleting it from pend table'''
cursor.execute("use planner")
ta_id=int(input("enter task to shift to done : "))
sql1= "INSERT INTO done SELECT * FROM pend WHERE t_id=%s"
cursor.execute(sql1,(ta_id,))
sql2= "DELETE FROM PEND WHERE t_id=(%s)"
cursor.execute(sql2,(ta_id,))
mydb.commit()
print("pending task completed.")
print("choose option 5 to see all the tasks done")
#Showing data
def show_tasks():
'''shows records from table tasks'''
cursor.execute("use planner")
cursor.execute("select * from tasks order by t_id")
record=cursor.fetchall()
l1=[]
for i in record:
x=l1.append(i)
if len(l1)==0:
print("no records there")
else:
print("showing tasks")
headers= ['id',"task","date","important"]
print(tabulate(l1,headers=headers,tablefmt="grid"))
def show_pend():
'''shows records from table pend'''
cursor.execute("use planner")
cursor.execute("select * from pend order by t_id")
record=cursor.fetchall()
l2=[]
for i in record:
y=l2.append(i)
if len(l2)==0:
print("no records there")
else:
print("showing pending tasks")
headers= ['id',"task","date","important"]
print(tabulate(l2,headers=headers,tablefmt="grid"))
def show_done():
'''shows records from table done'''
cursor.execute("use planner")
cursor.execute("select * from done order by t_id")
record=cursor.fetchall()
l3=[]
for i in record:
z=l3.append(i)
if len(l3)==0:
print("no records there")
else:
print("showing tasks completed")
headers= ['id',"task","date","important"]
print(tabulate(l3,headers=headers,tablefmt="grid"))
l5=[]
def imp_pend(d):
cursor.execute("use planner")
a='yes'
sql4 = "select * from pend where important=%s"
cursor.execute(sql4, (a,))
record=cursor.fetchall()
for i in record:
d.append(i)
return d
l6=[]
def imp_done(e):
cursor.execute("use planner")
a='yes'
sql5 = "select * from done where was_important=%s"
cursor.execute(sql5, (a,))
record=cursor.fetchall()
for i in record:
e.append(i)
return e
def all_imp_task():
'''collects the value and shows the tasks which are important'''
imp_tasks(l4)
imp_pend(l5)
imp_done(l6)
l7=l4+l5+l6
l7.sort()
print("showing tasks that are important")
headers= ['id',"task","date","important"]
print(tabulate(l7,headers=headers,tablefmt="fancy_grid"))
#Main
def main():
if (mydb):
print("Connection Successful")
print(calendar.month(2020,current_date.month))
d2 = current_date.strftime("%B %d, %Y")
print("Today's date is", d2)
print(" ")
#create_dbnt()
data_entry_pend()
show_pend()
reply='yes'
while(reply=='yes'):
print("Choose the option to do the following tasks")
print("1. Enter a new task")
print("2. Shift task to done")
print("3. Shift pending task to done")
print("4. Show tasks")
print("5. show tasks done")
print("6. show pending tasks")
print("7. show tasks that are important")
print("8. exit")
ch=int(input("enter your choice : "))
if (ch==1):
data_entry_tasks()
print("====================================================
============================")
elif (ch==2):
data_entry_done()
print("====================================================
============================")
elif (ch==3):
data_entry_done2()
print("====================================================
============================")
elif (ch==4):
show_tasks()
print("====================================================
============================")
elif (ch==5):
show_done()
print("====================================================
============================")
elif (ch==6):
show_pend()
print("====================================================
============================")
elif (ch==7):
all_imp_task()
print("====================================================
============================")
elif (ch==8):
exit()
else:
print("option not available")
reply=input("Do you want to explore more yes/no : ")
else:
print("connection failed")
main()
OUTPUT SCREENSHOTS
1. Enter new task:
4. Show tasks:
5. Show tasks done:
6. Show pending tasks: