Rohil Vinod
Rohil Vinod
Rohil Vinod
COMPUTER SCIENCE
INVESTIGATORY PROJECT
Class :X11
XII A Reg.No:
CERTIFICATE
This is certified to be the bonafide workX11
of Mr.Rohil Vinod
Roll Number __________ Admission Number , Class XII,
Division A, of BPM MODEL SCHOOL during the
academic year 2024-2025 as prescribed by the Central Board
of Secondary Education.
Examiner Principal
ACKNOWLEDGEMENT
1. Introduction
2. Basic Modules
3. Survey of Technologies
5. Source Code
7. Screenshots
8. Conclusion
9. Bibliography
INTRODUCTION
Library management system is all about organizing, managing the
library and library-oriented tasks. It also involves maintaining the
database of entering new books and the record of books that have been
retrieved or issued, with their respective dates. The main aim of this
project is providing an easy to handle and automated library
management system. This project also provides features and interface
for maintaining student’s history of issue books. The user can easily
update, delete and insert data in the database with this project.
● MENULIB
● LIBRARY MANAGEMENT
● BOOK
● ISSUE
● MEMBER
MENULIB: This module accept choices from user related to book record
management, member record management and issuereturn choices.
BOOK: This module facilitates the option to add new books, delete existing
books and also search and update books.
ISSUE: This module show issued book details and the details about returned
books.
MEMBER: This module provide the option to add new member, delete
member and also search member
SURVEY OF TECHNOLOGIES
The following software are used in the project for the development
of LIBRARY MANAGEMENT SYSTEM.
HARDWARE SPECIFICATIONS:
SOFTWARE SPECIFICATIONS:
Library Management\n")
print("======================================================
===") print("1. Book
Management") print("2. Members
Management") print("3.
Issue/Return Book") print("4.
Exit")
print("======================================================
===") choice=int(input("Enter Choice between 1 to 4------
elif choice==2:
menulib.menumember()
elif choice==3:
menulib.menuissuereturn()
elif choice==4:
break
else: print("Wrong Choice......Enter Your Choice
again")
#Module: Menulib
import book
import member
import issue def
menubook():
while True:
book.clrscreen() print("\t\t\t Book
Record Management\n")
print("======================================================
") print("1. Add Book Record")
print("2. Display Book Records") print("3.
Search Book Record") print("4. Delete Book
Record") print("5. Update Book Record")
print("6. Return to Main Menu")
print("======================
===========================
=====
") choice=int(input("Enter Choice between 1 to 5-------> :
")) if choice==1:
book.insertData()
elif choice==2:
book.display() elif
choice==3:
book.SearchBookRec()
elif choice==4:
book.deleteBook()
elif choice==5:
print("No such Function")
elif choice==6:
return
Record Management\n")
print("======================================================
")
print("1. Add Member
Record") print("2. Display Member
Records") print("3. Search Member
Record")
print("4. Delete Member Record") print("5.
Update Book Record") print("6.
print("======================================================
") choice=int(input("Enter Choice between 1 to 5-------> :
")) if choice == 1:
member.insertMember()
elif choice == 2:
member.display() elif choice
== 3:
member.SearchMember() elif
choice == 4:
member.deleteMember()
elif choice == 5:
elif choice==6:
return
else:
Record Management\n")
print("==================================================")
print("1. Issue Book") print("2. Display Issued Book Records") print("3.
print("==================================================")
choice=int(input("Enter Choice between 1 to 4------> : "))
if choice==1:
issue.issueBookData()
elif choice==2:
issue.ShowIssuedBooks()
elif choice==3:
issue.returnBook()
elif choice==4:
return
else:
#Module: Book
def clrscreen(): if
platform.system()=="Windows":
print(os.system("cls")) def
display(): try:
os.system('cls') cnx =
connection.MySQLConnection(user='root',
password='root',host='localhost',database='Library'
) Cursor = cnx.cursor() query =
("SELECT * FROM bookrecord")
Cursor.execute(query) for
(bno,bname,auth,price,pub,qty,dop) in
Cursor:
print("==================================================")
print("Book Code : ",bno) print("Book
Name : ",bname) print("Author
of Book : ",auth) print("Price
of Book : ",price)
print("Publisher : ",pub)
print("Total Quantity in Hand : ",qty)
print("Purchased On : ",dop)
print("==================================================")
Cursor.close() cnx.close() print("You have done
it!!!!!!") except mysql.connector.Error as err: if err.errno
== errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist") else:
print(err)
else:
cnx.close()
def insertData():
try:
cnx =
connection.MySQLConnection(user='root',password='root',host='localhost',databas
e='Library')
Cursor = cnx.cursor() bno=input("Enter
Book Code : ") bname=input("Enter Book
Name : ") auth=input("Enter Book Author's
Name : ") price=int(input("Enter Book Price
: ")) pub=input("Enter Publisher of Book : ")
(bno,bname,auth,price,pub,qty,date(DD,MM,YY))
Cursor.execute(Qry,data)
# Make sure data is committed to the database cnx.commit()
cnx.commit() Cursor.close() cnx.close()
print("Record Inserted..............") except mysql.connector.Error
as err: if err.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
cnx =
connection.MySQLConnection(user='root',password='root',host='localhost',databas
e='Library')
Cursor = cnx.cursor()
bno=input("Enter Book Code of Book to be deleted from the Library : ")
Qry =("""DELETE FROM bookrecord WHERE bno = %s""") del_rec=(bno,)
Cursor.execute(Qry,del_rec)
# Make sure data is committed to the database cnx.commit()
Cursor.close() cnx.close() print(Cursor.rowcount,"Record(s)
Deleted Successfully..........") except mysql.connector.Error as err:
if err.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist") else:
print(err)
cnx.close() def
SearchBookRec(): try:
cnx =
connection.MySQLConnection(user='root',password='root',host='localhost',databas
e='Library')
Cursor = cnx.cursor() bno=input("Enter Book No to be
Searched from the Library : ") query = ("SELECT * FROM
bookrecord where bno = %s ") rec_srch=(bno,)
Cursor.execute(query,rec_srch)
Rec_count=0 for
(bno,bname,auth,price,pub,qty,dop) in
Cursor: Rec_count+=1
print("==================================================")
print("Book Code : ",bno) print("Book Name : ",bname)
print("Author of Book : ",auth) print("Price of Book : ",price)
print("Publisher : ",pub) print("Total Quantity in Hand :
",qty) print("Purchased On : ",dop)
print("==================================================")
if Rec_count%2==0:
input("Press any key to continue")
clrscreen() print(Rec_count,
"Record(s) found")
# Make sure data is committed to the database cnx.commit()
Cursor.close() cnx.close() except mysql.connector.Error
as err: if err.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist") else:
print(err)
cnx.close() def
updatebook():
try: cnx
=
connection.M
ySQLConnect
ion(user='root'
,password='ro
ot',host='local
host',databas
e='Library')
Cursor = cnx.cursor() bno=input("Enter Book Code of Book to be
Updated from the Library : ") query = ("SELECT * FROM
bookrecord where bno = %s ") rec_srch=(bno,) print("Enter new
data ") bname=input("Enter Book Name : ") auth=input("Enter
Book Author's Name : ") price=int(input("Enter Book Price : "))
pub=input("Enter Publisher of Book : ") qty=int(input("Enter Quantity
purchased : ")) print("Enter Date of Purchase (Date/MOnth and Year
seperately: ")
data = (bname,auth,price,pub,qty,date(YY,MM,DD),bno)
Cursor.execute(Qry,data)
# Make sure data is committed to the database cnx.commit()
Cursor.close() cnx.close() print(Cursor.rowcount,"Record(s)
Updated Successfully........") except mysql.connector.Error as
err: if err.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist") else:
print(err)
cnx.close()
UpdateBook()
#Module: Issue
Cursor = cnx.cursor()
query = ("SELECT B.bno,B.bname,M.mname,I.d_o_issue FROM bookrecord
B,issue I,member M where B.bno=I.bno and I.mno=M.mno")
print("====================================================="
) print("Book Code : ",bno) print("Book Name : ",bname)
print("Member Code : ",mno) print("Member Name : ",mname)
print("Date of issue : ",d_o_issue)
print("=====================================================")
Cursor.close() cnx.close() print("You have done
it!!!!!!") except mysql.connector.Error as err: if err.errno
== errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist") else:
print(err)
else:
cnx.close() def
ShowIssuedBooks(): try:
cnx =
connection.MySQLConnection(user='root',password='root',host='localhost',databas
e='Library')
Cursor = cnx.cursor() bno=input("Enter Book Code to
issue : ") mno=input("Enter Member Code : ") print("Enter
Date of Issue (Date/Month and Year separately): ")
DD=int(input("Enter Date : "))
cnx.close()
def returnBook():
try:
cnx =
connection.MySQLConnection(user='root',password='root',host='localhost',databas
e='Library')
Cursor = cnx.cursor()
bno=input("Enter Book Code of Book to be returned to the Library : ")
Mno=input("Enter Member Code of Member who is returning Book : ")
retDate=date.today()
rec=(retDate,bno,Mno)
Cursor.execute(Qry,rec)
# Make sure data is committed to the database cnx.commit()
Cursor.close() cnx.close() print(Cursor.rowcount,"Record(s)
Deleted Successfully..........") except mysql.connector.Error as err:
if err.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or
password") elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist") else:
print(err)
cnx.close()
#Module: Member
# print('\n' *5)
(mno,mname,mob,dop,addr) in Cursor:
print("======================================================
========")
print("Member Code : ",mno)
print("Member Name : ",mname) print("Mobile
No.of Member : ",mob) print("Date of
Membership : ",dop) print("Address : ",addr)
print("======================================================
=========")
Cursor.close() cnx.close()
print("You have
done it!!!!!!")
except mysql.connector.Error as err: if err.errno
== errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist") else:
print(err)
else:
cnx.close()
def insertMember():
try:
cnx =
connection.MySQLConnection(user='root',password='root',host='localhost',databas
e='Library')
Cursor = cnx.cursor() mno=input("Enter Member Code : ")
mname=input("Enter Member Name : ") mob=input("Enter Member
Mobile No. : ") print("Enter Date of Membership (Date/MOnth and
Year seperately: ")
= (mno,mname,mob,date(YY,MM,DD),addr)
Cursor.execute(Qry,data)
# Make sure data is committed to the database
cnx.commit() Cursor.close() cnx.close()
print("Record Inserted..............") except mysql.connector.Error
as err: if err.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist") else:
print(err)
cnx.close() def
deleteMember(): try:
cnx =
connection.MySQLConnection(user='root',password='root',host='localhost',databas
e='Library')
Cursor = cnx.cursor() mno=input("Enter Member Code to be deleted
from the Library : ") Qry =("""DELETE FROM member
Cursor.execute(Qry,del_rec)
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist") else:
print(err)
cnx.close()
def SearchMember():
try:
cnx =
connection.MySQLConnection(user='root',password='root',host='localhost',databas
e='Library')
Cursor = cnx.cursor() mnm=input("Enter Book Name to be
Searched from the Library : ") query = ("SELECT * FROM
member where mname = %s ") rec_srch=(mnm,)
Cursor.execute(query,rec_srch)
Rec_count=0 for
(mno,mname,mob,dop,addr) in Cursor:
print("======================================================
========")
print("Member Code : ",mno)
print("Member Name : ",mname) print("Mobile
No.of Member : ",mob) print("Date of
Membership : ",dop) print("Address : ",addr)
print("==================================
====================
=========")
if Rec_count%2==0:
input("Press any key to continue") clrscreen()
print(Rec_count, "Record(s) found") # Make sure data is
committed to the database cnx.commit()
Cursor.close() cnx.close() except
mysql.connector.Error as err: if err.errno ==
errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist") else:
print(err) cnx.close()
DATABASE DETAILS
Database : Library
1. Table : bookrecord
2. Table: issue
3. Table: member
2. https://www.tutorialspoint.com/python
3. www.geeksforgeeks.org