0% found this document useful (0 votes)
72 views27 pages

Document 1

This document is a report submitted by students Jeeva J and Mukilan S for their library management system project. It includes sections like introduction, abstract, advantages, disadvantages, source code, and acknowledgements. The introduction provides an overview of what a library management system is and what it aims to do. The abstract summarizes the main objectives of automating library functions. It then discusses some theory around library management and specifications of the project before including the Python source code developed and various screenshots of the system outputs.

Uploaded by

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

Document 1

This document is a report submitted by students Jeeva J and Mukilan S for their library management system project. It includes sections like introduction, abstract, advantages, disadvantages, source code, and acknowledgements. The introduction provides an overview of what a library management system is and what it aims to do. The abstract summarizes the main objectives of automating library functions. It then discusses some theory around library management and specifications of the project before including the Python source code developed and various screenshots of the system outputs.

Uploaded by

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

VEDANTA ACADEMY SENIOR SECONDARY

SCHOOL, COIMBATORE

LIBRARY MANAGEMENT SYSTEM

DONE BY:
Jeeva. J
Mukila
n. S

Computer Science Project on


LIBRARY MANAGEMENT SYSTEM
Report submitted to the Central Board of Secondary Education
in Partial fulfillment of the required for the award of Senior
Secondary
By

J. JEEVA AND S. MUKILAN

Under the guidance of

Mr SARAVANAN
DEPARTMENT OF COMPUTER SCIENCE

CERTIFICATE

This is to certify that the project work entitled PARKING


MANAGEMENT SYSTEM which is submitted by J. JEEVA
AND S. MUKILAN is a bonafide record of the work carried by
them in Grade XII - ‘A’ as a part of COMPUTER SCIENCE
PROJECT at VEDANTA ACADEMY SENIOR SECONDARY
SCHOOL, Coimbatore in the academic year 2022-2023
______________ _____________
Staff Incharge Principal

________________
________________
Internal Examiner External Examiner

ACKNOWLEGEMENT

No creation in this world is a solo effort. Neither is this project. It would


not have been possible without the kind support and help of many
individuals and organizations. I take this opportunity to express my
gratitude to all of them.
I thank the God and my parents for providing me with everything that I
required in completing this project.

I would like to express a deep sense of gratitude to y project guide Mr


SARAVANAN for guiding me immensely through the course of the
project. He always evinced keen interest in my work. His constructive
advice and constant motivation were responsible for the completion of
this project.
My sincere thanks to our Principal, Mr Saravanan for his immense
support
I also thank my friends and all those who have been instrumental in the
successful completion of the project.
INDEX

 PROJECT ANALYSIS
 INTRODUCTION
 ABSTRACT
 THEORY
 ADVANTAGES
 DISADVANTAGES
 SPECIFICATIONS
 SOURCE CODE
 OUTPUT SCREENING
 BIBLIOGRAPHY
 THANK YOU WISHES

PROJECT ANALYSIS

Our application program is specially


Designed for the public library named
“READING COMMUNITY”

They lend books to readers who subscribed


with the library

We have tried to maximise the efficiency and strived for


Customer and user ease as well as satisfaction.

We have thoroughly examined the need of the library and


after the analysis, we have constructed the program.

We have used PYTHON and MYSQL as our platform


to carry out this task.

INTRODUCTION

The library management system is a software to manage manual functions of a library. The
software helps to manage the entire library operations from maintaining book records to issue a
book. In addition, it allows streamlined management of fine details of books such as author
name, edition, and many other important details. So, it is easier to search for books and find the
right materials for students and the librarian.
The electronic management via the software is essential to track information like issue date, due
date, who has borrowed any material, etc. The system is developed and designed with an aim to
facilitate efficient management to the schools to manage a modern library with accurate data
management. Thus, school management or library head can get all the necessary details
electronically he prime benefits of the automated library management system are to reduce
overheads and increase productivity. The librarians can maintain all library functions easily. It
facilitates the administrators to keep an eye on the library department’s all functions. Also, it
enables librarians and users to save time on daunting tasks and enhances efficiency. In short, this
system supports keeping the records of all transactions of the books available in the library.

ABSTRACT
 The main objective of this project is to easily manage the record of books in the library.
 It manages all the data such as add, update, and delete records; time of submission;
Search a record and add new books
 It manages the information of books
 Helps the librarian to enter details without any confusion

THEORY

Managing a library requires knowledge of library management and skills to perform the
activities. The task involves planning, decision making, organizing, collecting and disbursing
information and controlling and monitoring the various functions.

The management should have an objective for running the library. They should have a they wish
to serve. The selection of books in different categories is dependent on the interests of the
members.
Library management clear idea of the members software system makes the primary functions of
adding and deleting, issuing and returning of books very simple. The processes of book indexing,
cataloging, book reservations and overdue notifications are automated. The software system
makes the process simpler and more accountable.
ADVANTAGES OF LIBRARY MANAGEMENT

 Simple and easy to operate


 Increase librarian’s efficiencies
 Mobile access, anytime, anywhere
 Search, add, update, and view library materials online
 Helps to manage library functions constructively
 Saves time and reduces overheads
 Reduce library’s operating cost
 Customized reports for better management
 Remove manual processes to issue books and maintain records

DISADVANTAGES OF LIBRARY MANAGEMENT

 Online stored data is predisposed to cyber hacks. Opting for a reliable online system
reduces the risk
 sometimes it is complicated to operate for first-time users
 Requires high-speed internet connectivity for a web-based system
 Risk of computer virus
 Unlike online systems that use cloud computing, Open source system stocks data on the
computer’s hard drive. This raises the risk of data loss.

SOURCE CODE

from tkinter import *


import mysql.connector as p
from tkinter import messagebox
from tkinter.ttk import Combobox
from tkinter.ttk import Treeview
import datetime

b1, b2, b3, b4, cur, con, e1, e2, e3, e4, e5, i, ps = None, None, None, None, None, None, None,
None, None, None, None, None, None
window, win = None, None
com1d, com1m, com1y, com2d, com2m, com2y = None, None, None, None, None, None

month = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',
'October', 'November',
'December']
y = list(range(2020, 2040))
d = list(range(1, 32))

def loginlibr():
global window
connectdb()
for i in range(cur.rowcount):
data = cur.fetchone()
if e1.get().strip() == str(data[0]) and e2.get().strip() == str(data[1]):
closedb()
libr()
break
else:
window.withdraw()
closedb()
home()
def libr():
global window
window.withdraw()
global win, b1, b2, b3, b4
win = Tk()
win.title('Library')
win.geometry("500x400+480+180")
win.resizable(False, False)
b1 = Button(win, height=2, width=25, text=' Add Book ', command=addbook)
b2 = Button(win, height=2, width=25, text=' Issue Book ', command=issuebook)
b3 = Button(win, height=2, width=25, text=' Return Book ', command=returnbook)
b4 = Button(win, height=2, width=25, text=' View Book ', command=viewbook)
b5 = Button(win, height=2, width=25, text=' Issued Book ', command=issuedbook)
b6 = Button(win, height=2, width=25, text=' Delete Book ', command=deletebook)
b7 = Button(win, height=2, width=25, text=' LogOut ', command=logout)
b1.place(x=110, y=30)
b2.place(x=110, y=80)
b3.place(x=110, y=130)
b4.place(x=110, y=180)
b5.place(x=110, y=230)
b6.place(x=110, y=280)
b7.place(x=110, y=330)
win.mainloop()

def addbook():
global win
win.destroy()
win = Tk()
win.title('Add Book')
win.geometry("500x400+480+180")
win.resizable(False, False)
sub = Label(win, text='GENRE')
tit = Label(win, text='TITLE')
auth = Label(win, text='AUTHOR')
ser = Label(win, text='SERIAL NO')
global e1, b, b1
e1 = Entry(win, width=25)
global e2
e2 = Entry(win, width=25)
global e3
e3 = Entry(win, width=25)
global e4
e4 = Entry(win, width=25)
b = Button(win, height=2, width=21, text=' ADD BOOK TO DB ', command=addbooks)
b1 = Button(win, height=2, width=21, text=' CLOSE ', command=closebooks)
sub.place(x=70, y=50)
tit.place(x=70, y=90)
auth.place(x=70, y=130)
ser.place(x=70, y=170)
e1.place(x=180, y=50)
e2.place(x=180, y=90)
e3.place(x=180, y=130)
e4.place(x=180, y=170)
b.place(x=180, y=210)
b1.place(x=180, y=252)
win.mainloop()

def addbooks():
connectdb()
q = 'INSERT INTO Book VALUE("%s","%s","%s","%i")'
global cur, con
cur.execute(q % (e1.get(), e2.get(), e3.get(), int(e4.get())))
con.commit()
win.destroy()
messagebox.showinfo("Book", "Book Added")
closedb()
libr()

def closebooks():
global win
win.destroy()
libr()

def issuebook():
global win
win.destroy()
win = Tk()
win.title('Issue Book')
win.geometry("500x400+480+180")
win.resizable(False, False)
name = Label(win, text='ISSUE ', font='Helvetica 30 bold')
branch = Label(win, text='BOOK', font='Helvetica 30 bold')

sid = Label(win, text='STUDENT ID')


no = Label(win, text='BOOK NO')
issue = Label(win, text='ISSUE DATE')
exp = Label(win, text='EXPIRY DATE')
global e1, b, b1
e1 = Entry(win, width=25)
global e4
e4 = Entry(win, width=25)
global com1y, com1m, com1d, com2y, com2m, com2d
com1y = Combobox(win, value=y, width=5)
com1m = Combobox(win, value=month, width=5)
com1d = Combobox(win, value=d, width=5)
com2y = Combobox(win, value=y, width=5)
com2m = Combobox(win, value=month, width=5)
com2d = Combobox(win, value=d, width=5)
now = datetime.datetime.now()
com1y.set(now.year)
com1m.set(month[now.month - 1])
com1d.set(now.day)
com2y.set(now.year)
com2m.set(month[now.month - 1])
com2d.set(now.day)
b = Button(win, height=2, width=21, text=' ISSUE BOOK’ command=issuebooks)
b1 = Button(win, height=2, width=21, text=' CLOSE ', command=closebooks)
name.place(x=55, y=30)
branch.place(x=225, y=30)
sid.place(x=70, y=130)
no.place(x=70, y=170)
issue.place(x=70, y=210)
exp.place(x=70, y=240)
e1.place(x=180, y=130)
e4.place(x=180, y=170)
com1y.place(x=180, y=210)
com1m.place(x=230, y=210)
com1d.place(x=280, y=210)
com2y.place(x=180, y=240)
com2m.place(x=230, y=240)
com2d.place(x=280, y=240)
b.place(x=178, y=270)
b1.place(x=178, y=312)
win.mainloop()

def issuebooks():
connectdb()
q = 'INSERT INTO BookIssue VALUE("%s","%s","%s","%s")'
i = datetime.datetime(int(com1y.get()), month.index(com1m.get()) + 1, int(com1d.get()))
e = datetime.datetime(int(com2y.get()), month.index(com2m.get()) + 1, int(com2d.get()))
i = i.isoformat()
e = e.isoformat()
cur.execute(q % (e1.get(), e4.get(), i, e))
con.commit()
win.destroy()
messagebox.showinfo("Book", "Book Issued")
closedb()
libr()

def returnbook():
global win
# win.destroy()
win = Tk()
win.title('Return Book')
win.geometry("500x400+480+180")
win.resizable(False, False)
ret = Label(win, text='RETURN ', font='Helvetica 30 bold')
book = Label(win, text='BOOK', font='Helvetica 30 bold')
no = Label(win, text='BOOK NO')
date = Label(win, text='RETURN DATE')
exp = Label(win, text='')
global b, b1
global e4
e4 = Entry(win, width=25)
global com1y, com1m, com1d, com2y, com2m, com2d
com1y = Combobox(win, value=y, width=5)
com1m = Combobox(win, value=month, width=5)
com1d = Combobox(win, value=d, width=5)
'''com2y=Combobox(win,width=5)
com2m=Combobox(win,width=5)
com2d=Combobox(win,width=5)'''
now = datetime.datetime.now()
com1y.set(now.year)
com1m.set(month[now.month - 1])
com1d.set(now.day)

b = Button(win, height=2, width=21, text=' RETURN BOOK ', command=returnbooks)


b1 = Button(win, height=2, width=21, text=' CLOSE ', command=closebooks)
ret.place(x=55, y=30)
book.place(x=225, y=30)
no.place(x=70, y=120)
date.place(x=70, y=160)
exp.place(x=70, y=200)
e4.place(x=180, y=120)
com1y.place(x=180, y=160)
com1m.place(x=230, y=160)
com1d.place(x=280, y=160)
'''com2y.place(x=180,y=200)
com2m.place(x=230,y=200)
com2d.place(x=280,y=200)'''
b.place(x=178, y=200)
b1.place(x=178, y=242)
win.mainloop()

def returnbooks():
connectdb()
q = 'SELECT exp FROM BookIssue WHERE serial="%s"'
cur.execute(q % (e4.get()))
e = cur.fetchone()
e = str(e[0])
i = datetime.date.today()
e = datetime.date(int(e[:4]), int(e[5:7]), int(e[8:10]))
if i <= e:
a = 'DELETE FROM BookIssue WHERE serial="%s"'
cur.execute(a % e4.get())
con.commit()
else:
t = str((i - e) * 10)
messagebox.showinfo("Fine", t[:4] + ' Fine ')
win.destroy()
closedb()
libr()

def viewbook():
win = Tk()
win.title('View Books')
win.geometry("800x300+270+180")
win.resizable(False, False)

treeview = Treeview(win, columns=("Subject", "Title", "Author", "Serial No"),


show='headings')
treeview.heading("Subject", text="Subject")
treeview.heading("Title", text="Title")
treeview.heading("Author", text="Author")
treeview.heading("Serial No", text="Serial No")
treeview.column("Subject", anchor='center')
treeview.column("Title", anchor='center')
treeview.column("Author", anchor='center')
treeview.column("Serial No", anchor='center')
index = 0
iid = 0
connectdb()
q = 'SELECT * FROM Book'
cur.execute(q)
details = cur.fetchall()
for row in details:
treeview.insert("", index, iid, value=row)
index = iid = index + 1
treeview.pack()
win.mainloop()
closedb()

def issuedbook():
connectdb()
q = 'SELECT * FROM BookIssue'
cur.execute(q)
details = cur.fetchall()
if len(details) != 0:
win = Tk()
win.title('View Books')
win.geometry("800x300+270+180")
win.resizable(False, False)
treeview = Treeview(win, columns=("Student ID", "Serial No", "Issue Date", "Expiry
Date"), show='headings')
treeview.heading("Student ID", text="Student ID")
treeview.heading("Serial No", text="Serial No")
treeview.heading("Issue Date", text="Issue Date")
treeview.heading("Expiry Date", text="Expiry Date")
treeview.column("Student ID", anchor='center')
treeview.column("Serial No", anchor='center')
treeview.column("Issue Date", anchor='center')
treeview.column("Expiry Date", anchor='center')
index = 0
iid = 0
for row in details:
treeview.insert("", index, iid, value=row)
index = iid = index + 1
treeview.pack()
win.mainloop()
else:
messagebox.showinfo("Books", "No Book Issued")
closedb()

def deletebook():
global win
win.destroy()
win = Tk()
win.title('Delete Book')
win.geometry("500x400+480+180")
win.resizable(False, False)
usid = Label(win, text='Serial NO')
paswrd = Label(win, text='PASSWORD')
global e1
e1 = Entry(win)
global e2, b2
e2 = Entry(win)
b1 = Button(win, height=2, width=17, text=' DELETE ', command=deletebooks)
b2 = Button(win, height=2, width=17, text=' CLOSE ', command=closebooks)
usid.place(x=80, y=100)
paswrd.place(x=70, y=140)
e1.place(x=180, y=100)
e2.place(x=180, y=142)
b1.place(x=180, y=180)
b2.place(x=180, y=230)
win.mainloop()
def deletebooks():
connectdb()
if e2.get() == 'admin':
q = 'DELETE FROM Book WHERE serial="%i"'
cur.execute(q % (int(e1.get())))
con.commit()
win.destroy()
messagebox.showinfo("Delete", "Book Deleted")
closedb()
libr()
else:
messagebox.showinfo("Error", "Incorrect Password")
closedb()

def loginadmin():
if e1.get() == 'admin' and e2.get() == 'admin':
admin();

def admin():
window.withdraw()
global win, b1, b2, b3, b4, cur, con
win = Tk()
win.title('Admin')
win.geometry("500x400+480+180")
win.resizable(False, False)
b1 = Button(win, height=2, width=25, text=' Add User ', command=adduser)
b2 = Button(win, height=2, width=25, text=' View User ', command=viewuser)
b3 = Button(win, height=2, width=25, text=' Delete User ', command=deleteuser)
b4 = Button(win, height=2, width=25, text=' LogOut ', command=logout)
b1.place(x=110, y=70)
b2.place(x=110, y=120)
b3.place(x=110, y=170)
b4.place(x=110, y=220)
win.mainloop()

def logout():
win.destroy()
try:
closedb()
except:
print("Logged Out")
home()
def closedb():
global con, cur
cur.close()
con.close()

def adduser():
global win
win.destroy()
win = Tk()
win.title('Add User')
win.geometry("500x400+480+180")
win.resizable(False, False)
name = Label(win, text='NAME')
usid = Label(win, text='USER ID')
branch = Label(win, text='BRANCH')
mob = Label(win, text='MOBILE NO')
global e1, b
e1 = Entry(win, width=25)
global e2
e2 = Entry(win, width=25)
global e3
e3 = Entry(win, width=25)
global e4
e4 = Entry(win, width=25)
b = Button(win, height=2, width=21, text=' ADD USER ', command=addusers)
b1 = Button(win, height=2, width=21, text=' CLOSE ', command=closeusers)
name.place(x=70, y=100)
usid.place(x=70, y=140)
branch.place(x=70, y=180)
mob.place(x=70, y=220)
e1.place(x=180, y=100)
e2.place(x=180, y=140)
e3.place(x=180, y=180)
e4.place(x=180, y=220)
b.place(x=178, y=250)
b1.place(x=178, y=293)
win.mainloop()

def addusers():
connectdb()
q = 'INSERT INTO Login VALUE("%s","%i","%s","%i")'
global con, cur
cur.execute(q % (e1.get(), int(e2.get()), e3.get(), int(e4.get())))
con.commit()
win.destroy()
messagebox.showinfo("User", "User Added")
closedb()
admin()

def closeusers():
global win
win.destroy()
admin()

def viewuser():
win = Tk()
win.title('View User')
win.geometry("800x300+270+180")
win.resizable(False, False)
treeview = Treeview(win, columns=("Name", "User ID", "Branch", "Mobile No"),
show='headings')
treeview.heading("Name", text="Name")
treeview.heading("User ID", text="User ID")
treeview.heading("Branch", text="Branch")
treeview.heading("Mobile No", text="Mobile No")
treeview.column("Name", anchor='center')
treeview.column("User ID", anchor='center')
treeview.column("Branch", anchor='center')
treeview.column("Mobile No", anchor='center')
index = 0
iid = 0
connectdb()
details = cur.fetchall()
for row in details:
treeview.insert("", index, iid, value=row)
index = iid = index + 1
treeview.pack()
win.mainloop()
closedb()

def deleteuser():
global win
win.destroy()
win = Tk()
win.title('Delete user')
win.geometry("500x400+480+180")
win.resizable(False, False)
usid = Label(win, text='USER ID')
paswrd = Label(win, text='ADMIN \n PASSWORD')
global e1
e1 = Entry(win)
global e2, b2
e2 = Entry(win)
b1 = Button(win, height=2, width=17, text=' DELETE ', command=deleteusers)
b2 = Button(win, height=2, width=17, text=' CLOSE ', command=closeusers)
usid.place(x=80, y=100)
paswrd.place(x=70, y=140)
e1.place(x=180, y=100)
e2.place(x=180, y=142)
b1.place(x=180, y=180)
b2.place(x=180, y=230)
win.mainloop()

def deleteusers():
connectdb()
if e2.get() == 'admin':
q = 'DELETE FROM Login WHERE userid="%i"'
cur.execute(q % (int(e1.get())))
con.commit()
win.destroy()
messagebox.showinfo("Delete", "User Deleted")
closedb()
admin()
else:
messagebox.showinfo("Error", "Incorrect Password")
closedb()

def connectdb():
global con, cur
# Enter your username and password of MySQL
con = p.connect(host="localhost", user="root", passwd="Jeeva@123")
cur = con.cursor(buffered=True)
cur.execute('CREATE DATABASE IF NOT EXISTS Library')
cur.execute('USE Library')
global enter
if enter == 1:
l = 'CREATE TABLE IF NOT EXISTS Login(name varchar(20),userid varchar(10),branch
varchar(20),mobile int(10))'
b = 'CREATE TABLE IF NOT EXISTS Book(subject varchar(20),title varchar(20),author
varchar(20),serial int(5))'
i = 'CREATE TABLE IF NOT EXISTS BookIssue(stdid varchar(20),serial
varchar(10),issue date,exp date)'
cur.execute(l)
cur.execute(b)
cur.execute(i)
enter = enter + 1
query = 'SELECT * FROM Login'
cur.execute(query)

def home():
try:
global window, b1, b2, e1, e2, con, cur, win
window = Tk()
window.title('Welcome')
window.resizable(False, False)
window.geometry("500x400+480+180")
wel=Label(window,text='LIBRARY MANAGEMENT',font='Consolas 28 bold')
usid = Label(window, text='USER ID')
paswrd = Label(window, text='PASSWORD')
e1 = Entry(window, width=22)
e2 = Entry(window, width=22)
b1 = Button(window, text=' LOGIN AS LIBRARIAN', height=2, width=20,
command=loginlibr)
b2 = Button(window, text=' LOGIN AS ADMIN ', height=2, width=20,
command=loginadmin)
wel.place(x=90,y=20)
usid.place(x=70, y=100)
paswrd.place(x=70, y=140)
e1.place(x=180, y=100)
e2.place(x=180, y=140)
b1.place(x=175, y=180)
b2.place(x=175, y=225)
window.mainloop()
except Exception:
window.destroy()

enter = 1
home()
OUTPUT SCREENING
Python Outputs
1. Login Page

2. Login as Admin

3. Admin Home page


4. Add User

5. View user
6. Delete User

7. Log out

8. Login as Librarian

9. Librarian Menu Page


10. Add book

11. Issue Book


12. Return Book

13. View Book


14. Issued Books
15. Delete Book

16. Log out

MySQL output

1. SHOW TABLES;
2. SELECT * FROM BOOK;

3. SELECT * FROM BOOKISSUE;

4. SELECT * FROM LOGIN;

BIBLIOGRAPHY

 Computer science by Sumita Arora Class XII


 Internet

You might also like