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

Library Project Print

Uploaded by

Bhavya Bhatt
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)
3 views

Library Project Print

Uploaded by

Bhavya Bhatt
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/ 22

TATACHEM DAV PUBLIC SCHOOL

MITHAPUR, DWARKA (GUJ.)

A Project Report

on

LIBRARY MANAGEMENT SYSTEM


For

20_________ Examination

As a part of the Informatics Practices (065) Course

SUBMITTED BY:

M ……………………………….. Roll No…………………………


M ……………………………….. Roll No…………………………
M ……………………………….. Roll No…………………………
M ……………………………….. Roll No…………………………
M ……………………………….. Roll No…………………………

Under the Guidance of:


Mr. Rajkumar Sharma, PGT Computer

1
CERTIFICATE
This is to certify that the Project entitled, LIBRARY MANAGEMENT
SYSTEM is a bonafide work done by M ……………….….………………..,
M .…………………………………….., M ……………………………..………..,
M ……………..………………….. and M ……………………..…….. of class
12 Session in partial fulfillment of CBSE’s Examination and has been
carried out under my direct supervision and guidance. This report or a
similar report on the topic has not been submitted for any other
examination and does not form a part of any other course undergone by
the candidate.

………………………….. …………………………..
Signature of student Signature of student

Name : ……………………… Name : ………………………


Roll No. : …………………… Roll No. : ……………………

………………………….. …………………………..
Signature of student Signature of student

Name : ……………………… Name : ………………………


Roll No. : …………………… Roll No. : ……………………

…………………………..
Signature of student

Name : ………………………
Roll No. : ……………………

........................................ ........................................
Signature of Teacher/Guide Signature of Principal

Name : ………………….……….…. Name : ………………..………….


Designation: ……………….…. Place :………………………..….
Date : ……………………………… Date : ……………………………

2
Declaration
We declare that this project entitled “Library Management

System” done at TATACHEM DAV PUBLIC SCHOOL, MITHAPUR,

DWARKA is a record of project work submitted by ourselves for

the partial fulfillment of the 10+2 of CBSE under the supervision

and guidance of Mr. Rajkumar Sharma.

The Project is genuine and not a reproduction of any project

previously done or submitted.

M .……………………………..……………………..

M .……………………………..……………………..

M .……………………………..……………………..

M .……………………………..……………………..

M .……………………………..……………………..

3
Acknowledgement
We extend our sincere thanks to our school TATACHEM DAV
PUBLIC SCHOOL, MITHAPUR, DWARKA which provided
ourselves with the opportunity to fulfill our wish and achieve our
goal.

We would like to express deep debt to Mr. Rajkumar Sharma,


project guide for his vital suggestions, meticulous guidance and
constant motivation which went a long way in the successful
completion of this project.

We cannot move on without thank beloved principal Mr. R.K.


SHARMA for creating the required academic environment which
made our task appreciable.

On a moral personal note, our deepest appreciation and gratitude


to our beloved parents, who have been an inspiration and have
provided them with unrelenting encouragement and support.

M .……………………………..……………………..

M .……………………………..……………………..

M .……………………………..……………………..

M .……………………………..……………………..

M .……………………………..……………………..

4
Index
S.No. Contents Page No
1 Introduction 6
2 Database & tables 7
3 Hardware & Software Requirement 8
To create library database and student table,
4 9
book table, issue table

5 To show all menus of Library Management 10-11


System
6 To add a new student details 12
7 To add a new book details 13
8 To issue a book of library 14-15
9 To return a book of library 16-17
10 To show all the details of students 18
11 To show all the details of books 19
12 To show all the details of issued book 20
13 To show all the details of not return book 21
14 To find book details by book name 22

5
Introduction
A Library management system is software that uses to maintain the record
of the library. It contains work like the numbers of available books in the
library, the number of books are issued or returning or renewing a book or
late fine charge record, etc. Library Management Systems is software that
helps to maintain a database that is useful to enter new books & record
books borrowed by the members, with the respective submission dates.
Moreover, it also reduces the manual record burden of the librarian.

Library management system allows the librarian to maintain library


resources in a more operative manner that will help to save their time. It is
also convenient for the librarian to manage the process of books allotting
and making payment. Library management system is also useful for
students as well as a librarian to keep the constant track of the availability
of all books in a store.

There are ten types of actions performed by this project –

1. To create library database and student table, book table, issue table

2. To add a new student details

3. To add a new book details

4. To issue a book of library

5. To return a book of library

6. To show all the details of students

7. To show all the details of books

8. To show all the details of issued book

9. To show all the details of not return book

10. To find book details by book name

6
Database used in this project:

7
Hardware & Software Requirements
Minimum Hardware Requirements
Processor: Pentium 4 or above

Main Memory: 1 GB

Hard Disk: 20 GB

Software Requirements
Platform: Windows NT / XP / 7 / 8.0/ 10

Client Side Validation : Python 3.7 IDE

Server Side Validation : MySQL Server

Database Connectivity : ODBC (Open Database Connectivity)

RDBMS: MySQL 6.0

8
create.py
TO CREATE LIBRARY DATABASE AND STUDENT TABLE, BOOK TABLE, ISSUE TABLE
import mysql.connector as mycon

def data1():

mydb = mycon.connect(

host="localhost",

user="root",

password="root",

mycursor = mydb.cursor()

mycursor.execute("CREATE DATABASE if not exists library")

mycursor.execute("use library")

mycursor.execute("CREATE TABLE if not exists login (user VARCHAR(15), pass

VARCHAR(15))")

mycursor.execute("insert into login (user, pass) values('raj','123')")

mycursor.execute("CREATE TABLE if not exists student (sid integer primary key, name

VARCHAR(25), class VARCHAR(5), section VARCHAR(5), dateofbirth date)")

mycursor.execute("CREATE TABLE if not exists book (bid integer primary key, bname

VARCHAR(25), author VARCHAR(15), price integer, status varchar(12))")

mycursor.execute("CREATE TABLE if not exists issue (issueid integer primary key, sid

integer, bid integer, issuedate date, returndate date)")

print("Library Database and student table, book table, issue table Created")

mydb.commit()

mydb.close()

9
projectstart.py
To Show All the Menus of Library Management System

#Menu Driven Program for LIBRARY MANAGEMENT SYSTEM


import mysql.connector as mycon
import create
import studentinsert
import bookinsert
import issue
import returnbook
import studentdetails
import bookdetails
import issuebookeddetails
import notreturnbookeddetails
import bookdetailsbyname

create.data1()
mydb = mycon.connect(
host="localhost",
user="root",
password="root",
database="library"
)

mycursor = mydb.cursor()

print("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$")
print(" LIBRARY MANAGEMENT SYSTEM")
print("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$")
print()
print("*************************************************************************")
print("***********************************************************************")

while(1):

user=input("Enter User Name:")


passw=input("Enter Password:")

mycursor.execute("select * from login where user=%s and pass=%s", (user, passw))


data = mycursor.fetchone()

if data==None:
print("Sorry, User Name or Password is incorrect. try again...")
continue

print("Login Successful.....")

10
mydb.close()
input()
break
while(1):
print("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$")
print(" LIBRARY MANAGEMENT SYSTEM")
print("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$")
print()
print("*************************************************************************")
print("*************************************************************************")
print(" 1. TO CREATE LIBRARY DATABASE AND STUDENT TABLE, BOOK TABLE, ISSUE
TABLE")
print(" 2. TO ADD A NEW STUDENT DETAILS")
print(" 3. TO ADD A NEW BOOK DETAILS")
print(" 4. TO ISSUE A BOOK OF LIBRARY")
print(" 5. TO RETURN A BOOK OF LIBRARY")
print(" 6. TO SHOW ALL THE DETAILS OF STUDENTS")
print(" 7. TO SHOW ALL THE DETAILS OF BOOKS")
print(" 8. TO SHOW ALL THE DETAILS OF ISSUED BOOK")
print(" 9. TO SHOW ALL THE DETAILS OF NOT RETURN BOOK")
print(" 10. TO FIND BOOK DETAILS BY BOOK NAME")
print(" 11. EXIT")
print("***********************************************************************")
print("***********************************************************************")
ch=int(input("Enter your choice(from the above 10 options):"))
if(ch==1):
create.data1()
input()
if(ch==2):
studentinsert.data1()
input()
if(ch==3):
bookinsert.data1()
input()
if(ch==4):
issue.data1()
input()
if(ch==5):
returnbook.data1()
input()
if(ch==6):
studentdetails.data1()
input()
if(ch==7):
bookdetails.data1()
input()
if(ch==8):
issuebookeddetails.data1()
input()
if(ch==9):
notreturnbookeddetails.data1()
input()

if(ch==10):
bookdetailsbyname.data1()
input()

if(ch==11):
break

11
studentinsert.py
TO ADD A NEW STUDENT DETAILS

import mysql.connector as mycon

def data1():
mydb = mycon.connect(
host="localhost",
user="root",
password="root",
database="library"
)

mycursor = mydb.cursor()
sid=input("Enter Student Id:")

mycursor.execute("select * from student where sid=%s", (sid,))


data = mycursor.fetchone()

if not data==None:
print("Student Id Already Present.")
return

name=input("Enter Student Name:")


class1=input("Enter Class:")
section=input("Enter Section:")
dateofbirth=input("Enter Date of Birth:")

mycursor.execute("INSERT INTO student (sid, name,class,section,dateofbirth) VALUES (%s, %s,


%s,%s,%s)", (sid, name,class1,section,dateofbirth))
mydb.commit()
print(mycursor.rowcount, "record inserted.")

print("show all the records")


mycursor.execute("select * from student")
data = mycursor.fetchall()
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format("Sid","Name","Class","Section","Date of
Birth"))
for row in data:
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format(row[0], row[1], row[2], row[3],str(row[4])))

mydb.commit()
mydb.close()

12
bookinsert.py
TO ADD A NEW BOOK DETAILS

import mysql.connector as mycon

def data1():
mydb = mycon.connect(
host="localhost",
user="root",
password="root",
database="library"
)

mycursor = mydb.cursor()
bid=input("Enter Book Id:")

mycursor.execute("select * from book where bid=%s", (bid,))


data = mycursor.fetchone()

if not data==None:
print("Book Id Already Present.")
return

bname=input("Enter Book Name:")


author=input("Enter Author Name:")
price=input("Enter Book Price:")
status="returned"

mycursor.execute("INSERT INTO book (bid, bname,author,price,status) VALUES (%s, %s,


%s,%s,%s)", (bid, bname,author,price,status))
mydb.commit()
print(mycursor.rowcount, "record inserted.")

print("show all the records")


mycursor.execute("select * from book")
data = mycursor.fetchall()
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format("Bid","Book Name","Author","Price","Status"))
for row in data:
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format(row[0], row[1], row[2], row[3],str(row[4])))

mydb.commit()
mydb.close()

13
issue.py
TO ISSUE A BOOK OF LIBRARY

import mysql.connector as mycon

def data1():
mydb = mycon.connect(
host="localhost",
user="root",
password="root",
database="library"
)

mycursor = mydb.cursor()
issueid=input("Enter Issue Id:")

mycursor.execute("select * from issue where issueid=%s", (issueid,))


data = mycursor.fetchone()

if not data==None:
print("Issue Id Already Present.")
return

sid=input("Enter Student Id:")

mycursor.execute("select * from student where sid=%s", (sid,))


data = mycursor.fetchone()

if data==None:
print("Student Id is Not Found")
return

bid=input("Enter Book Id:")

mycursor.execute("select * from book where bid=%s", (bid,))


14
data = mycursor.fetchone()

if data==None:
print("Book Id is Not Found")
return

if not data==None:
if data[4]=="issued":
print("Book Already issued")
return

issuedate=input("Enter Book Issue Date:")

mycursor.execute("update book set status=%s where bid=%s", ("issued",bid))


mycursor.execute("INSERT INTO issue (issueid, sid,bid,issuedate) VALUES (%s, %s, %s,%s)",
(issueid, sid,bid,issuedate))
mydb.commit()
print(mycursor.rowcount, "record inserted.")

print("Show all the Issued Books Details")


mycursor.execute("select * from issue")
data = mycursor.fetchall()
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format("Issueid","Sid","Book
ID","IssueDate","ReturnDate"))
for row in data:
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format(row[0], row[1], row[2], str(row[3]),str(row[4])))

mydb.commit()
mydb.close()

15
returnbook.py
TO RETURN A BOOK OF LIBRARY

import mysql.connector as mycon

def data1():
mydb = mycon.connect(
host="localhost",
user="root",
password="root",
database="library"
)

mycursor = mydb.cursor()
issueid=input("Enter Issue Id:")

mycursor.execute("select * from issue where issueid=%s", (issueid,))


data = mycursor.fetchone()
issueid=data[0]
sid=data[1]
bid=data[2]

if data==None:
print("Issue Id is not Found")
return

mycursor.execute("select * from student where sid=%s", (sid,))


data = mycursor.fetchone()
print("Show all the Student Details")
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format("Sid","Student Name","Class","Section","Date of
Birth"))

16
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format(data[0], data[1], data[2], data[3],str(data[4])))

mycursor.execute("select * from book where bid=%s", (bid,))


data = mycursor.fetchone()
print("Show all the Book Details")
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format("Bid","Book Name","Author","Price","Status"))
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format(data[0], data[1], data[2], data[3],data[4]))

mycursor.execute("select * from issue where issueid=%s", (issueid,))


data = mycursor.fetchone()
print("Show all the Issued Books Details")
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format("Issueid","Sid","Book
ID","IssueDate","ReturnDate"))
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format(data[0], data[1], data[2], str(data[3]),str(data[4])))

returndate=input("Enter Book Return Date:")

mycursor.execute("update book set status=%s where bid=%s", ("returned",bid))


mycursor.execute("update issue set returndate=%s where issueid=%s", (returndate,issueid))
mydb.commit()
print(mycursor.rowcount, "record updated.")

print("Show all the Issued Books Details")


mycursor.execute("select * from issue")
data = mycursor.fetchall()
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format("Issueid","Sid","Book
ID","IssueDate","ReturnDate"))
for row in data:
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format(row[0], row[1], row[2], str(row[3]),str(row[4])))

mydb.commit()
mydb.close()

17
studentdetails.py
TO SHOW ALL THE DETAILS OF STUDENTS

import mysql.connector as mycon

def data1():
mydb = mycon.connect(
host="localhost",
user="root",
password="root",
database="library"
)

mycursor = mydb.cursor()
print("Details of all Students")
mycursor.execute("select * from student")
data = mycursor.fetchall()
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format("SId","Student Name","Class","Section","Date
of Birth"))
for row in data:
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format(row[0], row[1], row[2], row[3],str(row[4])))

mydb.commit()
mydb.close()

18
bookdetails.py
TO SHOW ALL THE DETAILS OF BOOKS

import mysql.connector as mycon

def data1():
mydb = mycon.connect(
host="localhost",
user="root",
password="root",
database="library"
)

mycursor = mydb.cursor()
print("Details of all Books")
mycursor.execute("select * from book")
data = mycursor.fetchall()
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format("Book Id","Book
Name","Author","Price","Status"))
for row in data:
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format(row[0], row[1], row[2], row[3],row[4]))

mydb.commit()
mydb.close()

19
issuebookeddetails.py
TO SHOW ALL THE DETAILS OF ISSUED BOOK

import mysql.connector as mycon

def data1():
mydb = mycon.connect(
host="localhost",
user="root",
password="root",
database="library"
)

mycursor = mydb.cursor()
print("Details of all Issued Books")
mycursor.execute("select * from issue")
data = mycursor.fetchall()
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format("Issue Id","Book Id","Student Id","Issue
Date","Return Date"))
for row in data:
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format(row[0], row[1], row[2], str(row[3]),str(row[4])))

mydb.commit()
mydb.close()

20
notreturnbookeddetails.py
TO SHOW ALL THE DETAILS OF NOT RETURN BOOK

import mysql.connector as mycon

def data1():
mydb = mycon.connect(
host="localhost",
user="root",
password="root",
database="library"
)

mycursor = mydb.cursor()
print("Details of all Issued Books")
mycursor.execute("select * from issue where returndate is null")
data = mycursor.fetchall()
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format("Issue Id","Book Id","Student Id","Issue
Date","Return Date"))
for row in data:
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format(row[0], row[1], row[2], str(row[3]),str(row[4])))

mydb.commit()
mydb.close()

21
bookdetailsbyname.py
TO FIND BOOK DETAILS BY BOOK NAME

import mysql.connector as mycon

def data1():
mydb = mycon.connect(
host="localhost",
user="root",
password="root",
database="library"
)

mycursor = mydb.cursor()
print("Show Selected Book Names Details")
bname=input("Enter Book Name:")

mycursor.execute("select * from book where bname like concat(%s,'%')",(bname,))


data = mycursor.fetchall()

count=mycursor.rowcount

if count==0:
print("Sorry,Record Not found")
else:
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format("Book Id","Book
Name","Author","Price","Status"))
for row in data:
print ("{:<10} {:<20} {:<20} {:<20}{:<20}".format(row[0], row[1], row[2], row[3],row[4]))

mydb.commit()
mydb.close()

22

You might also like