PROJECT
PROJECT
AISSCE 2023-24
Your Subject Name (Sub-Code)-XII
PROJECT REPORT
Page 1
DECLARATION
I (Your name), bearing roll no (your rollno), a student of Class XII (Your School Name)
hereby declare that I own the full responsibility for the information, results etc.
provided in this PROJECT titled “Library Management System”. It has been developed
successfully by using the Data Handling concepts like data management, data
visualization etc. provided in the programming language Python at The (Your School
Name) in complete fulfillment of project (curriculum of Central Board of Secondary
Education CBSE of Informatics Practices (065) conducted by CBSE, New Delhi for the
academic session (2023-24).
I also declare that this project work has neither been submitted to any other board nor
published at any time by me in the past.
(Your Name)
Roll No: (Your Rollno)
Class 12
(Your School Name)
Page 2
This is to certify that the Informatics Practices project on Library Management System
has been successfully completed by (Your Name) of Class XII, (Your School Name) for
consideration in partial fulfillment of curriculum of Central Board of Secondary
Education (CBSE) of Informatics Practices (065) for the award of AISSCE Practical
Examination 2023-24.
I certify that this project is up to my expectation and as per the guidelines issued by the
CBSE.
___________________
(External Examiner)
___________________ ___________________
Page 3
ACKNOWLEDGEMENT
I take this opportunity to express my deep sense of gratitude to all those who
have been instrumental in preparation of this project.
I would also thank all of my parents and friends for their whole hearted support
and encouragement without with this project would not have been successful.
I could not forget Internet, Textbooks which provided me with sufficient matter
for reference.
Page 4
TABLE OF CONTENT
Sr No Topic Page No
Introduction 6
Problem Statement 7
Objective 8
Project Scope 9
Overview of Python 11
Overview of SQL 12
Project Module 13
SQL Code 16
Python Code 19
Outputs 32
Conclusion 41
Bibliography 42
Page 1
INTRODUCTION
Library refers to the place that contains all the books organized and maintained
by academic organisations and made accessible to its community members for
reference or borrowing.
Library management is all about tracking and controlling of books right from
buying to storing and using. It controls the entire flow of books from purchasing to
issue to return and ensures that you always have the right quantities of the right book
in the right location at the right time.
Page 2
PROBLEM STATEMENT
Page 3
OBJECTIVE
Page 4
PROJECT SCOPE
Managing all books, sufficient stocks, issue and return records and analyzing
transactions is a tedious job for any library. To do it more effectively and correctly a
good library control is required. This is provided by our application which have
following scope:
Page 5
SYSTEM REQUIREMENT AND SPECIFICATIONS
Software Requirements:
Operating System Window-7 and later versions (32bit, 64 bit)
Language Python
Plateform Python IDLE 3.7 (min)
Database MySQL
Database driver MySQL Connector
Plotting Matplotlib
Hardware Requirements:
Processor Pentium Dual Core (min) 32bit or 64 bit
Hard-Disk 160GB (min)
RAM 1GB (min)
Input/output Requirements:
Input Mouse (any)
Input Keyboard (any)
Output Monitor (any)
Output Printer (any)
Page 6
OVERVIEW OF PYTHON
Features of Python:
Page 7
OVERVIEW OF MYSQL
Characteristics of MySQL:
Since MySQL is released under an open-source license, it does not require any cost or
payment for its usage. Anyone can download and use this software from specific
location on Internet.
Page 8
PROJECT MODULES
Book module: This module helps you to add, modify, and delete book data.
Member module: This module helps you to add, modify, and delete member data.
Report module: This module is used to generate book details, member details, issue
bills, return bills and visualize data by plotting charts.
Main module: This module is starting interface of library which provides complete
menu for operating Library management system
Page 9
DATA FLOW DIAGRAM
PYTHON INTERFACE
MENU
Page 10
DATABASE DESIGN AND TABLE STRUCTURES
ISSUE
BOOK
ISSUEID INT (PRIMARY KEY)
BOOKID INT (PRIMARY KEY)
ISSUEDATE DATE
BNAME VARCHAR
MEMBERID INT (FOREIGN KEY) Websi
AUTHOR VARCHAR YouTu
BOOKID INT (FOREIGN KEY)
PRICE FLOAT Email
COPIES INT
COPIES INT telegra
REM_COPIES INT
RETURN
Page 11
SQL CODE
DATABASE DESIGN AND TABLE STRUCTURES
Page 12
Page 13
PYTHON
SOURCE CODE
MODULE DESIGNS
Page 14
MAIN MODULE
‘MAIN’ MODULE-
import book
import member
import transaction
import report
while(True):
print("="*80)
print("\t\t\t------Library Management System------\n")
print("="*80)
print("\t\t\t\tEnter Your Choice\n\t\t\t\t1.Book Details\n\t\t\t\t2.Member
Details\n\t\t\t\t3.Transaction\n\t\t\t\t4.Report\n\t\t\t\t5.Exit")
choice = int(input())
if choice == 1:
while(True):
print("\t\t\t\tEnter Your Choice\n\t\t\t\t1.Add Book Details\n\t\t\t\t2.
Edit Book Details\
\n\t\t\t\t3. Delete A Book\n\t\t\t\t4. Search A Book\n\t\t\t\t5. Update A
Book\
\n\t\t\t\t6. Back To Main Menu")
ch = int(input())
if ch==1:
book.book_input()
elif ch==2:
book.book_edit()
elif ch==3:
book.book_delete()
elif ch==4:
book.book_search()
elif ch==5:
book.book_update()
elif ch==6:
break
elif choice ==2:
while(True):
print("\t\t\t\tEnter Your Choice\n\t\t\t\t1.Add Member Details\n\t\t\t\t2.
Edit Member Details\
\n\t\t\t\t3. Delete A Member\n\t\t\t\t4. Search A Member\n\t\t\t\t5.
Back To Main Menu")
ch = int(input())
Page 15
if ch==1:
member.member_input()
elif ch==2:
member.member_edit()
elif ch==3:
member.member_delete()
elif ch==4:
member.member_search()
elif ch==5:
break
elif choice == 3:
while(True):
print("\t\t\t\tEnter Your Choice\n\t\t\t\t1.Issue Book\n\t\t\t\t2. Return
Book\n\t\t\t\t3. Back To Main Menu")
ch = int(input())
if ch==1:
transaction.book_issue()
elif ch==2:
transaction.book_return()
elif ch==3:
break
elif choice == 4:
while(True):
print("\t\t\t\tEnter Your Choice\n\t\t\t\t1.Book Details\n\t\t\t\t2. Member
Details\
\n\t\t\t\t3. Issue Details\n\t\t\t\t4. Return Details\n\t\t\t\t5. Best
Reading Book (Chart)\
\n\t\t\t\t6. Back To Main Menu")
ch = int(input())
if ch==1:
report.book_output()
elif ch==2:
report.member_output()
elif ch==3:
report.issue_output()
elif ch==4:
report.return_output()
elif ch==5:
report.col_chart()
elif ch==6:
break
elif choice == 5:
break
Page 16
‘BOOK’ MODULE-
def book_edit():
x=int(input("Enter Book ID"))
qry="select * from book where bookid = {};".format(x)
cursor.execute(qry)
r=cursor.fetchone()
if r:
y=float(input("Enter New Price"))
qry = "update book set price = {} where bookid = {};".format(y,x)
cursor.execute(qry)
con.commit()
print("Edited Successfully.")
else:
print("Wrong Book ID")
def book_update():
x=int(input("Enter Book ID"))
qry="select * from book where bookid = {};".format(x)
cursor.execute(qry)
r=cursor.fetchone()
Page 17
print("Present Copies- ",r[4])
print("Present Remaining Copies- ",r[5])
if r:
y=float(input("Enter No of New Copies"))
qry = "update book set copies = {}, rem_copies = {} where bookid =
{};".format(r[4]+5,r[5]+5,x)
cursor.execute(qry)
con.commit()
print("Updated Successfully.")
qry="select * from book where bookid = {};".format(x)
df = pd.read_sql(qry,con)
print("New Updated Book Details")
print(tabulate(df, headers = 'keys', tablefmt = 'psql', showindex = False))
else:
print("Wrong Book ID")
def book_delete():
x=int(input("Enter Book ID"))
qry="select * from book where bookid = {};".format(x)
cursor.execute(qry)
r=cursor.fetchone()
if r:
qry = "delete from book where bookid = {};".format(x)
cursor.execute(qry)
con.commit()
print("deleted Successfully.")
else:
print("Wrong Book ID")
def book_search():
x=int(input("Enter Book ID"))
qry="select * from book where bookid = {};".format(x)
cursor.execute(qry)
r=cursor.fetchone()
if r:
df = pd.read_sql(qry,con)
print(tabulate(df, headers = 'keys', tablefmt = 'psql', showindex = False))
else:
print("Wrong Book ID")
Page 18
‘MEMBER’ MODULE-
import book
import mysql.connector as sqlt
import pandas as pd
from tabulate import tabulate
def member_edit():
x=int(input("Enter Member ID"))
qry="select * from member where memberid = {};".format(x)
cursor.execute(qry)
r=cursor.fetchone()
if r:
y=input("Enter New Address")
qry = "update member set madd = '{}' where memberid = {};".format(y,x)
cursor.execute(qry)
con.commit()
print("Edited Successfully.")
else:
print("Wrong Member ID")
def member_delete():
x=int(input("Enter Member ID"))
qry="select * from member where memberid = {};".format(x)
cursor.execute(qry)
Page 19
r=cursor.fetchone()
if r:
else:
print("Wrong member ID")
def member_search():
x=int(input("Enter Member ID"))
qry="select * from member where memberid = {};".format(x)
cursor.execute(qry)
r=cursor.fetchone()
if r:
df = pd.read_sql(qry,con)
print(tabulate(df, headers = 'keys', tablefmt = 'psql', showindex = False))
else:
print("Wrong Member ID")
Page 20
‘TRANSACTION’ MODULE-
import book
import mysql.connector as sqlt
import pandas as pd
from tabulate import tabulate
con = sqlt.connect(host = "localhost", user = "root", passwd = "sanjay", database =
"library")
cursor = con.cursor()
def book_issue():
q = "select max(issueid) from issue;"
cursor.execute(q)
r = cursor.fetchone()[0]
if r:
issueid = r+1
else:
issueid = 1
x=int(input("Enter Member ID"))
q1 = "select * from member where memberid = {};".format(x)
cursor.execute(q1)
r=cursor.fetchone()
if r:
y =int(input("Enter Book ID"))
q2 = "select bookid, rem_copies from book where bookid = {};".format(y)
cursor.execute(q2)
r=cursor.fetchone()
if r:
if r[1] > 0:
issuedate = input("Enter Issue Date")
copies = int(input("Enter No of Copies"))
remcopies = r[1] - copies
q3 = "insert into issue values({},'{}',{},{},{});".format(issueid, issuedate, x, y,copies)
cursor.execute(q3)
q4 = "update book set rem_copies = {} where bookid = {};".format(remcopies,y)
cursor.execute(q4)
con.commit()
print("Book Issued...")
else:
print("Book is Not Available")
else:
print("Wrong Book ID ")
else:
print("Wrong Memeber Id")
Page 21
def book_return():
q = "select max(returnid) from returns;"
cursor.execute(q)
r = cursor.fetchone()[0]
if r:
reutrnid = r+1
else:
returnid = 1
x=int(input("Enter Member ID"))
q1 = "select * from member where memberid = {};".format(x)
cursor.execute(q1)
r=cursor.fetchone()
if r:
y =int(input("Enter Book ID"))
q2 = "select bookid, rem_copies from book where bookid = {};".format(y)
cursor.execute(q2)
r=cursor.fetchone()
if r:
else:
print("Wrong Book ID ")
else:
print("Wrong Memeber Id")
Page 22
‘REPORT’ MODULE-
import mysql.connector as sqlt
import pandas as pd
from tabulate import tabulate
import matplotlib.pyplot as plt
con = sqlt.connect(host = "localhost", user = "root", passwd = "sanjay", database =
"library")
cursor = con.cursor()
def book_output():
df = pd.read_sql("select * from book",con)
print(tabulate(df, headers = 'keys', tablefmt = 'psql', showindex = False))
def member_output():
df = pd.read_sql("select * from member",con)
print(tabulate(df, headers = 'keys', tablefmt = 'psql', showindex = False))
def return_output():
df = pd.read_sql("select * from returns",con)
print(tabulate(df, headers = 'keys', tablefmt = 'psql', showindex = False))
def issue_output():
df = pd.read_sql("select * from issue",con)
print(tabulate(df, headers = 'keys', tablefmt = 'psql', showindex = False))
def col_chart():
q = "select bookid, count(copies) as totalcopies from issue group by bookid;"
df = pd.read_sql(q,con)
print(df)
plt.bar(df.bookid, df.totalcopies)
plt.xlabel("BookID")
plt.ylabel("Copies Issued")
plt.title("Best Reading Book")
plt.xticks(df.bookid)
plt.show()
Page 23
PROGRAM
OUTPUT
Page 24
MAIN MENU
Page 25
BOOK Module
ADD BOOK
EDIT BOOK
Page 26
SEARCH BOOK
DELETE ITEM
Page 27
MEMBER Module
Page 28
TRANSACTION MODULE
Page 29
REPORT MODULE
Page 30
DATA
ANALYSIS
BEST READING BOOK
Page 31
BEST READING BOOK
Page 32
CONCLUSION
We strongly believe that he implementation of this system will surely benefit the
organization.
Page 33
BIBLIOGRAPHY
Page 34
DATABASE DESIGN AND TABLE STRUCTURES
BOOK ISSUE
RETURN
MEMBER
RETURNID INT (PRIMARY KEY)
MEMBERID INT (PRIMARY KEY)
RETURNDATE DATE
MNAME VARCHAR
MEMBERID INT (FOREIGN KEY)
MADD VARCHAR
BOOKID INT (FOREIGN KEY)
PHONE CHAR(10)
Page 1
SQL CODE
Page 2
Page 3
HOW TO RUN PROJECT
READ EACH LINE CAREFULLY TILL THE END
1. सबसे पहले पाइथन को डाउनलोड एवं इनस्टॉल कर ले. डाउनलोड करने के ललए
https://www.python.org/downloads/ पर क्ललक करे .
2. डाउनलोड करने के पश्चात ् tabulate एवं pandas module को इनस्टॉल करे . इनस्टॉल करने के ललए
नीचे दी हुई वीडडयो (ललंक) को दे खे.
https://youtu.be/h9lHbIrSb7I
https://youtu.be/HEzxcvcj3_4
3. पाइथन इनस्टॉल करने के बाद आप MySQL को भी डाउनलोड एवं इस्टॉल करें . डाउनलोड करने के
ललए https://www.mysql.com/downloads पर क्ललक करे . इनस्टॉल करने के ललए नीचे दी हुई वीडडयो
(ललंक) को दे खे.
4. MySQL इनस्टॉल करने के पश्चात आप MySQLcode.docx फाइल को खोले एवं ददए हुए SQL कोड को
रन करके Library डेटाबेस और चारो टे बल (Book, Member, Issue, Return) को क्रिएट कर ले. ररफरे न्स
के ललए नीचे ददए हुए वीडडयो ललंक का प्रयोग करें .
Library Management (How to create tables): https://youtu.be/sySOfF2KxPI
5. अब आप main.py को डबल क्ललक कर प्रोजेलट को रन करें
6. पाइथन प्रोजेलट के सभी modules (main.py, book.py, member.py, transaction.py, report.py) को दे खने
हे तु आप उन्हें Python IDLE shell में खोले.
7. पूरे प्रोजेलट के ननमााण एवं प्रक्रिया को समझने हे तु तथा डाउट होने पर ननम्नललखखत वीडडयो को एक
एक करके दे खे :
a. Library Management Part-1: https://youtu.be/sySOfF2KxPI
b. Library management Part-2: https://youtu.be/qLclAd0cyjo
c. Library management Part-3: https://youtu.be/yrjQYMKSMUI
d. Library management Part-4: https://youtu.be/UrMMmdB8cJA
Page 1
HOW TO CREATE PROJECT REPORT FILE
READ EACH LINE CAREFULLY TILL THE END
Page 2