Rohil Vinod

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 37

BPM MODEL SCHOOL

Bhaskara Pillai Memorial Senior Secondary School

Perettil Moongodu (P. O),Varkala, Thiruvananthapuram, Kerala

COMPUTER SCIENCE
INVESTIGATORY PROJECT

Name : Rohil Vinod Batch:2024-2025

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.

Date:___________ Teacher In-Charge


(Computer Science Department)

Examiner Principal
ACKNOWLEDGEMENT

I am grateful to Almighty for giving me the strength to


successfully conduct my experiment and for sustaining my efforts
which many a time did oscillate.

It would be my pleasure to express my sincere thanks to my


Computer Science Teacher Shri.Arjun T.G in providing a helping
hand in this project. His valuable guidance, support, and
supervision all through this project are responsible for attaining its
present form.

I am obliged to our Principal Smt. Rajashree M S for providing the


best facilities and environment to bring out my innovation and
spirit of inquiry through this venture. I am grateful to my Parents
whose blessings and wishes have gone a long way in the
completion of this task.

Last but no the least I thank all my Friends and Classmates,


without their prompt support my efforts would be in vain.
CONTENTS

1. Introduction

2. Basic Modules

3. Survey of Technologies

4. Software and Hardware Requirements

5. Source Code

6. Data Base Details

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.

Functionalities of library management system are as follows:

● Manage books, member, issue and return related functions

● Provide book and member searching facilities

● Provide deletion of books and members

● Facilitate addition of new book to library

● It tracts all the information in a library.

● To increase efficiency of managing member and books

● Show updated information about books

● Editing, adding and uploading records


BASIC MODULES
The Library management system consist of following modules as
per their functionality are listed below:

● MENULIB

● LIBRARY MANAGEMENT

● BOOK

● ISSUE

● MEMBER

LIBRARY MANAGEMENT: This module contain the basic details of


library management and it accepts the choice from user to manage books,
members, issue and return books.

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.

1. PYTHON: Python is a widely used general-purpose, high level


programming language. It was initially designed by Guido van Rossum in
1991 and developed by Python Software Foundation. It was mainly
developed for emphasis on code readability, and its syntax allows
programmers to express concepts in fewer lines of code.
There are two major Python versions - Python 2 and Python 3. The version
used for this project is PYTHON 3.7.3
2. MY SQL: MySQL is an open-source relational database management
system (RDBMS). MySQL is free and open-source software under the
terms of the GNU General Public License. It is the world’s most popular
open source database. With its proven performance, reliability, and ease-
of-use, MySQL has become the leading database choice for web-based
applications, used by high profile web properties including Facebook,
Twitter, YouTube etc.
3. My SQL-Connector-Python: Python needs a MySQL driver to access the
MySQL database. This is a driver "My SQL Connector" used to connect
pythonMysql databases. We can install this connector using PIP
command.pip install mysql-connector-python
SOFTWARE &HARDWARE
REQUIREMENTS

HARDWARE SPECIFICATIONS:

⮚ PROCESSOR : PENTIUM DUAL CORE or


Above
⮚ RAM : 2 GB

⮚ HARD DISK : 500 GB

⮚ MONITOR : 14’’ LED or Above

⮚ KEYBOARD : 104 KEYS

⮚ MOUSE : OPTICAL MOUSE


24 Pin DOTMATRIX or above
⮚ PRINTER :

SOFTWARE SPECIFICATIONS:

⮚ OPERATING SYSTEM: WINDOWS 7 or Above

⮚ FRONT END : Python 3 or Above

⮚ MIDDLEWARE : Python-MySQL Connector


⮚ BACKEND `: MySQL
SOURCECODE
#Module: Library management

import menulib import


book import issue
import member
while True:
book.clrscreen() print("\t\t\t

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------

-> : ")) if choice==1:


menulib.menubook()

elif choice==2:
menulib.menumember()

elif choice==3:
menulib.menuissuereturn()
elif choice==4:
break
else: print("Wrong Choice......Enter Your Choice
again")

x=input("Enter any key to continue")

#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

else: print("Wrong Choice......Enter Your Choice


again") x=input("Enter any key to continue") def
menumember(): while True:
book.clrscreen() print("\t\t\t Member

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.

Return to Main Menu")

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:

print("No such Function")

elif choice==6:

return

else:

print("Wrong Choice......Enter Your Choice again") x=input("Enter


any key to continue") #

------------ def menuissuereturn(): while True:


book.clrscreen() print("\t\t\t Member

Record Management\n")
print("==================================================")
print("1. Issue Book") print("2. Display Issued Book Records") print("3.

Return Issued Book") print("4. Return to Main Menu")

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:

print("Wrong Choice......Enter Your Choice again") x=input("Enter

any key to continue")

#Module: Book

import mysql.connector from


mysql.connector import errorcode from
mysql.connector import(connection) import os
import platform

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 : ")

qty=int(input("Enter Quantity purchased : ")) print("Enter Date of

Purchase (Date/Month and Year separately): ")

DD=int(input("Enter Date : "))

MM=int(input("Enter Month : "))

YY=int(input("Enter Year : "))

Qry = ("INSERT INTO bookrecord


VALUES (%s, %s, %s, %s, %s, %s, %s)")
data =

(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:

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
deleteBook(): 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 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: ")

DD=int(input("Enter Date : "))

MM=int(input("Enter Month : "))

YY=int(input("Enter Year : "))

Qry = ("UPDATE bookrecord SET bname=%s,auth=%s,price=%s,pub=


%s,qty=%s,dop=%s,WHERE bno=%s")

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

import mysql.connector from


mysql.connector import errorcode from
mysql.connector import(connection) import os
import platform

def clrscreen(): print('\n' *5)


def issueBookData(): try:
os.system('cls') cnx =
connection.MySQLConnection(user='root',
password='root',host='localhost',database='Library')

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")

Cursor.execute(query) for (bno,bname,Mno,Mname,d_o_issue) in Cursor:

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 : "))

MM=int(input("Enter Month : "))

YY=int(input("Enter Year : "))


Qry = ("INSERT INTO issue (bno,mno,d_o_issue)VALUES(%s, %s, %s)")
data = (bno,mno,date(YY,MM,DD)) Cursor.execute(Qry,data)
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 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()

Qry =("""Update Issue set d_o_ret= %s WHERE BNO = %s and Mno= %s


""")

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

from mysql.connector import errorcode from


mysql.connector import (connection) import os
#def clrscreen():

# print('\n' *5)

def display(): try: os.system('cls') cnx =


connection.MySQLConnection(user='root',
password='root',host='localhost',database='LIbrary')
Cursor = cnx.cursor() query = ("SELECT *
FROM member") Cursor.execute(query)
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("======================================================
=========")

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: ")

DD=int(input("Enter Date : "))

MM=int(input("Enter Month : "))

YY=int(input("Enter Year : ")) addr=input("Enter


Member Adress : ")
Qry = ("INSERT INTO member VALUES (%s, %s, %s, %s, %s)") data

= (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

WHERE mno = %s""") del_rec=(mno,)

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 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

Create table bookrecord(bno int primary key, bname


varchar(30),auth varchar(30),price int, pub varchar(20),
qty int,dop date);

2. Table: issue

Create table issue(bno int primary key, mno int,


d_o_issue date, dor date);

3. Table: member

Create table member(mno int primary key, mname


varchar(30),mob int, date date, add varchar(30));
SCREENSHOTS
CONCLUSION

We have much delighted and relieved with the successful

completion of our project. We have made a small attempt in developing

a computer based solution for Library management system. This project

helped us immensely in understanding the basic principles behind the

operations involved within Python-MySQL project environment. This is

also enabled us to learn deeply in Python Pandas, Mat.plotlib, Numpy

libraries and PiPy Community.

We tested Library management System and are found to be

working satisfactorily and no serious errors are spotted. Hence this

software project has been developed to fulfill the academic learning in

CBSE Class XII, computer science curriculum.


BIBLIOGRAPHY
1. https://docs.python.org

2. https://www.tutorialspoint.com/python

3. www.geeksforgeeks.org

4. Think Python – Allen B Downey

5. Python Programming for Beginners – Jason Cannon

You might also like