0% found this document useful (0 votes)
35 views

PROJECT

Uploaded by

kashishc168
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

PROJECT

Uploaded by

kashishc168
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

]

AISSCE 2023-24
Your Subject Name (Sub-Code)-XII

PROJECT REPORT

Submitted By- Submitted To-


(YOUR NAME) (Your Teacher
Roll no-(----) name)
Class-XII (A) (PGT)

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)

___________________ ___________________

(Internal Examiner) (Principal)

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 feel great pleasure to express my obligation to (Your Principal Name), Principal


of (Your School Name).

I am also sincerely grateful to (Your Teacher Name) PGT (Computer Science),


(Your School Name) for his encouragement and valuable guidance during the entire
period of work.

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

System Requirement and Specification 10

Overview of Python 11

Overview of SQL 12

Project Module 13

Data Flow Diagram 14

Database Design and Table Structure 15

SQL Code 16

Python Code 19

Outputs 32

Data Analysis (Best Selling Product) 39

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.

Library Management System is an application which refers to Library


Management developed for Academic organizations. It can be used by organisations
to manage library using a computerized system where they can manage details of
books, members, book issue and book returns. They can also analyze data by
visualization.

Page 2
PROBLEM STATEMENT

For any Academic Organization, Library is one of the most important


departments that must be well managed in order to manage daily books activity
smoothly. But mostly organizations are not able to manage library as they do not have
good computerized system. As a result, they lack in

• Security of data, documents related to book transactions


• Unable to keep single copy of data at single location which increases data
complexity
• Managing data consistency
• Accessing and referencing or search data quickly
• Unable to analyze data as there is no mechanism to visualize data

Page 3
OBJECTIVE

The objective of project is to build an application program to:

• Provide function to manage books in the library more efficiently.


• Provide searching facility based on various factors.
• Reduce time and cost to control and manage library.
• Reduce paperwork.
• Increased accuracy and reliability.
• Increased Data Consistency.
• Increased Data security.

This application program can be used easily by non-programming personals.

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:

• ensures effective library control


• manage daily issue/return records easily and precisely
• can perform issue analysis of various books
• user friendly interface
• very easy to use
• High level security of data.

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

Python is a general purpose, dynamic, high-level, and interpreted programming


language. It supports Object Oriented programming approach to develop applications.
It is simple and easy to learn and provides lots of high-level data structures. Guido Van
Rossum is known as the founder of Python programming.

Features of Python:

• Python is a high-level language. It is a free and open-source language.


• It is an interpreted language, as Python programs are executed by an
interpreter.
• Python programs are easy to understand as they have a clearly defined syntax
and relatively simple structure.
• Python is case-sensitive. For TECHTIPNOW, NUMBER and number are not same
in Python.
• Python is portable and platform independent, means it can run on various
operating systems and hardware platforms.
• Python has a rich library of predefined functions.
• Python is also helpful in web development. Many popular web services and
applications are built using Python.
• Python uses indentation for blocks and nested blocks.

Page 7
OVERVIEW OF MYSQL

MySQL is a relational database management system (RDBMS). It is pronounced


as "My Sequel”. MySQL was originally founded and developed in Sweden by David
Axmark, Allan Larsson and Michael Widenius, who had worked together since the
1980s.

Characteristics of MySQL:

• MySQL is released under an open-source license so it is customizable.


• It requires no cost or payment for its usage.
• MySQL has superior speed, is easy to use and is reliable.
• MySQL uses a standard form of the well-known ANSI-SQL standards.
• MySQL is a platform independent application which works on many operating
systems like
• Windows, UNIX, LINUX etc. and have compatibility with many languages
including JAVA, C++, PHP, PERL, etc.
• MySQL is an easy to install RDBMS and is capable of handling large data sets.

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

Inventory Management System is divided into following 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.

Transaction module: This module further consists of:

• Issue module: This module is used to manage book issue information.


• Return module: This module is used to manage book return records.

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

ISSUE RETURN BOOK MEMBER

ADD UDATE SEARCH DELETE

MySQL Data Store

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

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) COPIES INT

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-

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_input():
try:
bookid=input("Enter Book Id")
bname = input("Enter Book Name")
author = input("Enter Author Name")
price = float(input("Enter Price"))
copies = int(input("Enter No of Copies"))
qry = "insert into book values({},'{}','{}',{},{},{});".format(bookid, bname, author, price,
copies,copies)
cursor.execute(qry)
con.commit()
print("added successfully..")
except:
print("Error.. Worng Entry")

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

con = sqlt.connect(host = "localhost", user = "root", passwd = "sanjay", database =


"library")
cursor = con.cursor()
def member_input():
try:
memberid=int(input("Enter Member Id"))
mname = input("Enter Member Name")
madd = input("Enter member Address")
phone = input("Enter Phone No")

qry = "insert into member values({},'{}','{}','{}');".format(memberid, mname, madd,


phone)
cursor.execute(qry)
con.commit()
print("added successfully..")
except:
print("Error...")

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:

qry = "delete from member where memberid = {};".format(x)


cursor.execute(qry)
con.commit()
print("deleted Successfully.")

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:

returndate = input("Enter return Date")


copies = int(input("Enter No of Copies"))

remcopies = r[1] + copies


q3 = "insert into returns values({},'{}',{},{},{});".format(returnid, returndate, x,
y,copies)
cursor.execute(q3)
q4 = "update book set rem_copies = {} where bookid = {};".format(remcopies,y)
cursor.execute(q4)
con.commit()
print("Book Returned...")

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

This Library Management System is a simple desktop-based application basically


suitable for small organization. It has all basic elements which are used for managing
Library of small organization. We are successful in making the application where we
can insert, delete, update, search and analyze records as per need. This application
also provides a report including chart of issue/return records to analyze the
performance.

We strongly believe that he implementation of this system will surely benefit the
organization.

Page 33
BIBLIOGRAPHY

References and Bibliography:

• Computer Science Class-XII NCERT Publication


• Computer Science Class-XII Sumita Arora
• Informatics Practices Class-XII NCERT Publication
• Informatics Practices Class-XII by Sumita Arora
• Think Python by Allen B Downey
• Python for everybody by Charles Severance
• Learning MYSQL by Seyed M. M. Tahaghoghi
• MySQL in a nutshell by Russell J. T. Dyer
• www.geeksforgeeks.org
• www.ncert.co.in

Page 34
DATABASE DESIGN AND TABLE STRUCTURES

BOOK ISSUE

BOOKID INT (PRIMARY KEY) ISSUEID INT (PRIMARY KEY)

BNAME VARCHAR ISSUEDATE DATE

AUTHOR VARCHAR MEMBERID INT (FOREIGN KEY) Websi


YouTu
PRICE FLOAT BOOKID INT (FOREIGN KEY)
Email
COPIES INT COPIES INT
telegra
REM_COPIES INT

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

1. सबसे पहले ‘project-report-Library-management-system-HEADER.docx’ फाइल को खोले और अपने


स्कूल/कॉलेज, अपना और अपने टीचसा का नाम ललखे (जहााँ ललखने को कहा गया है )
2. अब इसकी पीडीऍफ़ बनाकर इसे project-report-Library-management-system.pdf के साथ मजा (merge)
कर लसंगल पीडीऍफ़ फाइल बना ले

Page 2

You might also like