Comp - Sci. Library Management Python Project
Comp - Sci. Library Management Python Project
INFORMATICS
PRACTICES
Page.1
NAME: DARSHIT RAJESHBHAI VAGHASIYA
CLASS: XII-C
ROLL NO.: 04
CERTIFICATE
This is to certify that Master Darshit
Rajeshbhai Vaghasiya of class XII-C has
successfully completed the Informatics
Practices project on the topic Library
Page.2
Management under the guidance of
Alauddin Sayed sir during the academic
year 2020-21.
____________________
____________________
INTERNAL EXAMINER PRINCIPAL
____________________
____________________ DATE
EXTERNAL EXAMINER
Acknowledgement
I would like to express my special thanks of gratitude to
my teacher Mr.Alauddin Saiyad sir as well as our
principal Mr. Rajendra Prasad Maurya sir who gave me
the golden opportunity to do this project of Informatics
Practices, which also helped me in doing a lot of research
and I came to know new things about it. Without their
help, guidance and support it would have been
impossible to complete this project.
PROJECT ON
LIBRARY MANAGEMENT
2020-21
Group Members:
• Darshit Vaghasiya
• Sunny Soni
Page.4
• Vatsal Gandhi
INDEX
Sr.no Pag
Particulars
. e
1 Project Analysis 06
Functions and
2 07
Modules
Detailed
3 10
Description
4 Source Code 11
Outputs and
5 17
Tables
6 Bibliography 28
7 Remarks 29
Page.5
PROJECT ANALYSIS
Our application program is specially
designed for the public library named
“READING COMMUNITY.”
Page.6
FUNCTIONS AND
MODULES
Modules:
import mysql.connector:
FUNCTIONS:
connect():
This function establishes connection between Python and
MySQL
cursor():
Page.7
It is a special control structure that facilitates the row-
byrow processing of records in the result set.
The Syntax is:
<cursor object>=<connection object>.cursor()
execute():
This function is used to execute the sql query and retrieve
records using python.
The syntax is:
<cursor object>.execute(<sql query string>)
def():
fetchall():
This function will return all the rows from the result set in
the form of a tuple containing the records.
fetchone():
This Function will return one row from the result set in the
form of a tuple containing the records.
commit():
Page.8
This function provides changes in the database physically.
DETAILED DESCRIPTION
SOURCE CODE
For MySQL:
Page.10
int(50), issue_date
varchar(50));
For Python:
import mysql.connector as a
con=a.connect(host='localhost',user='root',passwd='9586',data
base='library_app')
def addbook(): bn=input("Enter
Book Name: ") ba=input("Enter
Author's Name: ")
c=int(input("Enter Book Code: "))
t=int(input("Total Books: "))
s=input("Enter Subject: ")
data=(bn,ba,c,t,s)
sql='insert into books values(%s,%s,%s,%s,%s);'
c=con.cursor()
c.execute(sql,data)
con.commit()
print("\n\n\n\nBook Added Successfully..........\n\n\n\n")
wait = input('\n\n\nPress enter to continue.....\n\n\n\n\n\n')
main()
def issueb(): n=input("Enter
Student Name: ")
Page.11
r=int(input("Enter Reg No.: "))
co=int(input("Enter Book Code: "))
d=input("Enter Date: ")
a="insert into issue values(%s,%s,%s,%s);"
data=(n,r,co,d) c=con.cursor()
c.execute(a,data)
con.commit()
print("\n\n\n\nBook issued successfully to: ",n)
wait = input('\n\n\nPress enter to continue.....\n\n\n\n\n\n')
bookup(co,-1)
main()
Page.12
c.execute(sql,d)
con.commit()
wait = input('\n\n\nPress enter to continue.....\n\n\n\n\n\n')
main()
def dbook(): ac=int(input("Enter
Book Code: "))
a="delete from books where bcode=%s;"
data=(ac,) c=con.cursor()
c.execute(a,data)
con.commit()
print("Book deleted successfully")
wait = input('\n\n\nPress enter to
continue.....\n\n\n\n\n\n\n\n\n\n\n\n')
main()
Page.13
def report_issued_books():
a="select * from issue;"
c=con.cursor()
c.execute(a)
myresult=c.fetchall() for
i in myresult:
print(myresult)
def report_return_books():
a="select * from return_;"
c=con.cursor()
c.execute(a)
myresult=c.fetchall() for i
in myresult:
print(myresult)
1. ADD BOOK
2. ISSUE OF BOOK
Page.14
3. RETURN OF BOOK
4. DELETE BOOK
5. DISPLAY BOOKS
6. REPORT MENU
7. EXIT PROGRAM
""")
''')
Page.15
main()
else:
print("Please try again........\n\n\n\n\n\n\n\n\n")
main() elif(choice=='7'):
print('\n\n\n\n\n\n\n\n\n\n\n\nThank you and have a great day
ahead...............\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n') else:
print("Please try again........\n\n\n\n\n\n\n\n\n\n\n\n")
main()
main()
OUTPUTS AND
TABLES
Page.16
➢ OUTPUTS:
Page.17
2.) Issue a Book:
Page.19
5.) Display Books:
Page.20
6.) Report Menu:
Page.21
Page.22
7.) Exit Program:
Page.23
➢ TABLES:
1.) Select * from Books:
Page.24
2.) Select * from Issue:
Page.25
3.) Select * from Return_
Page.26
BIBLIOGRAPHY
Page.27
❖ To develop this project many references
were used:
REMARKS
_____________________________________
_____________________________________
_____________________________________
_____________________________________
_____________________________________
Page.28
_____________________________________
_____________________________________
_____________________________________
_____________________________________
_____________________________________
_____________________________________
_____________________________________
_____________________________________
_____________________________________
_____________________________________
_____________________________________
_____________________________________
_____________________________________
___________
Page.29