You are on page 1of 44

Army Public School

S P Marg, Lucknow
2023-24
Computer Science Project
“LIBRARY MANAGEMENT
SYSTEM”

DURGESH SINGH
XII Science
Board Roll No :
Contents

Acknowledgement

Certificate

System Requirements

Synopsis

Coding

Screen Shots

Bibliography
ACKNOWLEDGEMENT

I wish to express my thanks and immense gratitude to


my project guide and supervisor Mr. Amit Trivedi under
whose kind advices this project has been prepared.
His able guidance, valuable suggestions at various
stages of the project has benefited in the completion
of the same.
I also express my deep sense of gratitude to Ms
Seema Tara (PRINCIPAL) for providing all facilities for
the project work.

DURGESH SINGH
XII Science
CERTIFICATE

This is to certify that “DURGESH SINGH” of class XII


has completed this project titled “LIBRARY
MANAGEMENT SYSTEM” under my supervision. I
certify that this project is up to my expectation and as
per the guidelines issued by CBSE, and may be
considered as part of the practical exam of AISSCE
conducted by CBSE.

_________ _________
Mr. Amit Trivedi Ms Seema Tara
PGT Computer Science Principal
Army Public School Army Public School
SP Marg, Lucknow SP Marg, Lucknow

_______________
External Examiner
System Requirments

1. PLATFORM:
 Windows 10
2. SOFTWARE:
 Python- IDLE 3.11
 DATABASE- MYSQL 8.0.1
 Microsoft Word 2016
3. HARDWARE:
 Intel Core i3
 4 GB RAM
 1TB Hard Disk
 800 X 1200 Screen Resolution
SYNOPSIS
The "Library Management System" is a
comprehensive software solution designed to
streamline and enhance the operations of a library.
This system is intended to provide librarians and
patrons with an efficient and user-friendly platform
for managing and accessing library resources.
The "Library Management System" aims to improve
the efficiency and accessibility of library services,
enhance the user experience for patrons, and
empower librarians with tools for effective resource
management. It offers a modern solution to the
evolving needs of libraries in the digital age,
fostering a seamless and engaging library
environment.
The "Library Management System" has been
developed to override the problems prevailing in the
practicing manual system. This software is supported
to eliminate and, in some cases, reduce the hardships
faced by this existing system. Moreover, this system
is designed for the particular need of the company to
carry out operations in a smooth and effective
manner.
The application is reduced as much as possible to
avoid errors while entering the data. It also provides
error message while entering invalid data. No formal
knowledge is needed for the user to use this system.
Thus, by this all it proves it is user-friendly. Library
Management System, as described above, can lead to
error free, secure, reliable and fast management
system. It can assist the user to concentrate on their
other activities rather to concentrate on the record
keeping. Thus, it will help organization in better
utilization of resources.
Every organization, whether big or small, has
challenges to overcome and managing the
information of Books, Student, Librarian, Address,
Member. Every Library Management System has
different Student needs; therefore, we design
exclusive employee management systems that are
adapted to your managerial requirements. This is
designed to assist in strategic planning, and will help
you ensure that your organization is equipped with
the right level of information and details for your
future goals. Also, for those busy executive who are
always on the go, our systems come with remote
access features, which will allow you to manage your
workforce anytime, at all times.
The Application includes:
 Login Form
 Admin Page
 Student Information
 Book Information
 Issuing Books
 Borrowing Books
These systems will ultimately allow you to better
manage resources
A Library Management System (LMS) offers
numerous advantages for libraries, librarians, and
patrons. Here are some of the key benefits:
1. Efficient Cataloging: LMS software allows
libraries to efficiently catalog and organize their
collections. This helps in easy retrieval of books
and other materials, reducing the time spent
searching for items.
2. Improved Accessibility: Patrons can easily search
for books and resources online through the
library's website or mobile app. This improves
accessibility, especially for users who may have
difficulty physically browsing the library.
3. Reduced Human Error: Automation in cataloging
and tracking reduces the chances of human errors
in record-keeping, leading to more accurate and
reliable information.
4. Streamlined Circulation: LMS systems automate
the circulation process, making it quicker and
more efficient. Patrons can check out and return
books themselves using self-checkout machines,
reducing wait times.
5. Enhanced Resource Management: Libraries can
keep track of the availability, condition, and
usage of their materials more effectively, which
helps in making informed decisions about
collection development and resource allocation.
6. Remote Access: Users can access digital
resources, e-books, and online databases
remotely, allowing them to borrow materials and
conduct research from anywhere with an internet
connection.
7. Data Analysis: LMS software provides valuable
data on library usage and patron behavior. This
data can be used to improve services, tailor
collections to user preferences, and plan for
future needs.
8. Security: LMS systems help in preventing theft
and unauthorized borrowing by providing
security features like anti-theft sensors, RFID
tags, and user authentication.
9. Easy Reporting: Libraries can generate reports on
various aspects of their operations, such as
circulation statistics, overdue items, and budget
allocation, to aid in decision-making.
10. Interlibrary Loans: LMS systems often
facilitate interlibrary loans, allowing patrons to
access materials from other libraries, expanding
their range of available resources.
11. Notifications: Automated notifications can
remind patrons of due dates, hold availability, or
upcoming library events, improving
communication between the library and its users.
12. Cost Savings: While implementing an LMS
requires an initial investment, it can lead to cost
savings over time due to increased efficiency,
reduced manual labor, and optimized resource
utilization.

13. User Satisfaction: By providing a more user-


friendly experience, an LMS can enhance user
satisfaction, attracting more patrons and retaining
existing ones.
14. Adaptability: LMS systems can adapt to
changing technology and user needs, allowing
libraries to incorporate new features and services
as they evolve.

15. Compliance: Libraries can ensure


compliance with copyright laws, licensing
agreements, and data protection regulations more
easily with the help of LMS tools.
In summary, a Library Management System offers
libraries the tools to modernize their operations,
improve user experiences, and make data-driven
decisions. It ultimately enhances the overall
efficiency and effectiveness of library services.
Python Modules
A Library Management System typically consists of
several interconnected modules or components that
work together to provide a comprehensive solution
for managing library operations. Here are the key
modules commonly found in such a system:

 1.ADMIN LOGIN:
 ADD BOOK
#Helps to add the books.

 ISSUE BOOK
# Help to Issues books.

 SUBMIT BOOK
#Helps to Submit books.

 DELETE BOOK
#Helps to Delete books.

 DISPLAY BOOKS
#Helps to Display all the books.
 LOGOUT

 2.STUDENT LOGIN:
 display books
#Helps to Display the books.

 Check Availability
#Helps to check the Available books.

 View Issued Books


#Helps to See the Issued books.

 View Submitted Books


#Helps to See the Submitted books.

 Logout

 3.Logout
#Simply LOGOUT from the Program
Database Table:
Programming Language and Database
Connectivity Used In Project:
Python:-
Python is an interpreted, object-oriented, high-level
programming language with dynamic semantics. Its
high-level built in data structures, combined with
dynamic typing and dynamic binding, make it very
attractive for Rapid Application Development, as well
as for use as a scripting or glue language to connect
existing components together. Python's simple, easy to
learn syntax emphasizes readability and therefore
reduces the cost of program maintenance. Python
supports modules and packages, which encourages
program modularity and code reuse. The Python
interpreter and the extensive standard library are
available in source or binary form without charge for
all major platforms, and can be freely distributed. The
Python installers for the Windows platform usually
include the entire standard library and often also
include many additional components. For Unix-like
operating systems Python is normally provided as a
collection of packages, so it may be necessary to use
the packaging tools provided with the operating
system to obtain some or all of the optional
components. Guido van Rossum began working on
Python in the late 1980s as a successor to the ABC
programming language and first released it in 1991 as
Python 0.9.0. Python 2.0 was released in 2000 and
introduced new features such as list comprehension,
cycledetecting garbage collection, reference counting,
and Unicode support. Python 3.0, 20 released in 2008,
was a major revision that is not completely backward-
compatible with earlier versions. Python 2 was
discontinued with version 2.7.18 in 2020. Python
consistently ranks as one of the most popular
programming languages.
MySQL:-
MySQL is a Relational Database Management
System (RDBMS) developed by Oracle that is based
on Structured Query Language (SQL). MySQL is one
of the most recognizable technologies in the modern
big data ecosystem. Often called the most popular
database and currently enjoying widespread, effective
use regardless of industry, it’s clear that anyone
involved with enterprise data or general IT should at
least aim for a basic familiarity of MySQL. With
MySQL, even those new to relational systems can
immediately build fast, powerful, and secure data
storage systems. MySQL’s programmatic syntax and
interfaces are also perfect gateways into the wide
world of other popular query languages and structured
data stores. A database is a structured collection of
data. It may be anything from a simple shopping list to
a picture gallery or a place to hold the vast amounts of
information in a corporate network. In particular, a
relational database is a digital store collecting data and
organizing it according to the relational model. In this
model, tables consist of rows and columns, and
relationships between data elements all follow a strict
logical structure. An RDBMS is simply the set of
software tools used to actually implement, manage,
and query such a database. MySQL is integral to many
of the most popular software stacks for building and
maintaining everything from customer-facing web
applications to powerful, datadriven B2B services. Its
open-source nature, stability, and rich feature set,
paired with ongoing development and support from
Oracle, have meant that internet-critical organizations
such as Facebook, Twitter, Wikipedia, and YouTube
all employ MySQL backends.
DATABASE:

DATABASE USED NAMED AS “LIBRARY”.


Coding

import mysql.connector as a
import pandas as pd

# Establish a connection to the MySQL database.

con = a.connect (host="localhost",user="root", passwd="sql",


database="library")

#Making function for Adding the books

def addbook():
#Taking all the information from user to issue book

bn = input("Enter BOOK Name: ")


c = input("Enter BOOK Code: ")
t = input("Total Books: ")
s = input("Enter Subject: ")
data = (bn,c,t,s)

#Writinf query for inserting the values


sql = 'insert into books values(%s, %s,%s, %s)'

#Creating Cursor and execute the query


c = con.cursor()
c.execute(sql,data)
#Commit
con.commit()
print(">-----------------------------------------<")
print("Data Entered Successfully")
main()

#Making function for issuing the books


def issueb():

#Taking all the information from user to issue book


n = input("Enter STUDENT Name: ")
r = input("Enter Reg No: ")
co = input("Enter Book Code: ")
d = input("Enter Date (YYYY-MM-DD): ")

#Writing query for inserting the data in table 'issue'


a = "insert into issue values(%s,%s,%s,%s)"
data = (n,r,co,d)

#Cursor object and execution of sql query


c = con.cursor()
c.execute(a,data)
#Commit
con.commit()
print(">-------------------------------------------<")
print("Book issued to:",n)

#update books availability


bookup(co,-1)
#Making function for submiting books
def submitb():

#Taking all the information from user to issue book


n = input("Enter student Name: ")
r = input("Enter Reg No: ")
co = input("Enter Book Code: ")
d = input("Enter Date(YYYY-MM-DD): ")

#Writing query for inserting the data in table 'submit'


a = "insert into submit values(%s, %s, %s, %s)"
data = (n,r,co,d)

#Cursor object and execution of sql query


c = con.cursor()
c.execute(a,data)
con.commit()
print(">---------------------------------------------<")
print("Book Submitted from: ",n)

#update books availability


bookup(co,1)

# Function to update the availability of a book in the database.


def bookup(co,u):

a="select TOTAL from books where BCODE=%s"


data=(co,)
#Cursor object and execution of sql query
c=con.cursor()
c.execute(a,data)
myresult=c.fetchone()

# Calculate the new total after updating availability


t=myresult[0]+u

# Update the 'books' table with the new total and write query
sql="update books set TOTAL=%s where BCODE=%s"
d=(t,co)

#Execution and commit


c.execute(sql,d)
con.commit()
#Return to the main menu
main()

#Making function for deleting books


def dbook():

#Taking all the information from user to issue book


ac = input("Enter Book Code: ")

#Writing query for deleting the data in table 'books'


a = "delete from books where BCODE = %s"
data = (ac,)

#Creating cursor and executing the query


c = con.cursor()
c.execute(a,data)

#commit
con.commit()
print(">--------------------------------------<")
print("SUCESSFULLY DELETED")

#Return to the main menu


main()

#Making function for displaying the books


def dispbook():

a = "select * from books"

#creating cursor and executing


c = con.cursor()
c.execute(a)
myresult = c.fetchall()

#printing all the values according to given information of user


for i in myresult:
#Printing as per user wants
print("Book Name : ",i[0])
print("Book Code: ",i[1])
print("Total: ",i[2])
print(">------------------------------------<")

#Return to the main menu


main()
#Making a function for checking the availablity of books
def check_availability():

#Taking information from the user


co = input("Enter Book Code: ")

#Writing a query for checking from table 'books'


query = "SELECT TOTAL FROM books WHERE BCODE = %s"
data = (co,)

#Creating cursor and execution of sql query


c = con.cursor()
c.execute(query, data)

result = c.fetchone()
if result:
if result[0] > 0:
print("Book is available.")
else:
print("Book is not available.")
else:
print("Invalid Book Code.")
op()
ch()

#Making function for view the issued books to the user


def view_issued_books():
n = input("Enter Reg No: ")
#Writing SQL query for Issuing book
a = "SELECT * FROM issue WHERE RegNo = %s"
data = (n,)

#creating cursor and executing the query


c = con.cursor()
c.execute(a, data)
myresult = c.fetchall()

# Create a DataFrame to store book records and save them to a CSV file

df = pd.DataFrame(myresult, columns=['Book Name', 'Book Code', 'Reg No', 'Issue Date'])

if not df.empty:
print(df)
else:

print("No issued books found for Reg No:", n)


print('>_________________________________________________<')

op()
ch()

#Making function for view the submit books to the user


def view_submitted_books():

#Taking all the information from the user


n = input("Enter Reg No: ")

print(">-----------------------------------------------<")
#Creating the query for submitting th books in the table 'submit'
a = "SELECT * FROM submit WHERE RegNo = %s"
data = (n,)

#Creating cursor and execution of the query


c = con.cursor()
c.execute(a, data)
myresult = c.fetchall()
#printing the all the information
for i in myresult:

#Printing as per user wants

print("Book Name : ",i[0])


print("Book Code: ",i[1])
print("Total: ",i[2])
print(">------------------------------------<")

print("SUCCESSFULLY SHOWN ALL THE INFORMATION")


op()
ch()
def main():
print("""

LIBRARY ADMIN

1. ADD BOOK

2. ISSUE BOOK

3. SUBMIT BOOK

4. DELETE BOOK

5. DISPLAY BOOKS

6.LOGOUT

""")

#Enter Choice for performing the task


ch = input("Enter Task No: ")

print(">---------------------------------------<")

if (ch == '1'):
addbook()
elif(ch=='2'):
issueb()

elif (ch=='3'):
submitb()

elif (ch=='4'):
dbook()

elif (ch=='5'):
dispbook()

elif (ch=='6'):
print('!!!GOODBYE!!!')

else:

print("WRONG CHOICE!!!!!!!!!!!")
main()

# Function for the initial manager password prompt.

def pswd():
ps=input("Enter Password:")
if ps=="py001":
main()
else:
print("WRONG PASSWORD!!!!!!!!")
pswd()
# Function for Student login and access to the student menu.

def student_login():
print('''
*******************************************************************************
***********************
STUDENT LOGIN
*******************************************************************************
***********************
''')

ch = input('1. display books\n2. Check Availability\n3. View Issued Books\n4. View


Submitted Books\n5. Logout\nEnter Task Number:')
print('''**************************************************
WELCOME TO STUDENT LOGIN
***************************************************''')

if (ch == '1'):
dispbook()

elif (ch=='2'):
check_availability()

elif (ch=='3'):
view_issued_books()

elif (ch=='4'):
view_submitted_books()
elif (ch=='5'):
print("SUCCESSFULLY LOGED OUT")

else:
print("WRONG CHOICE!!!!!!!!!!!")
student_login()

# Function for the initial manager password prompt.


def pswd():

ps = input("Enter Password (Admin Login):")


if ps == 'py001':
main()
else:
print("Wrong Password")
pswd()

#Crearted a function for get the option for Student and Admin login
def op():
print('''
Welcome to the Library System!
1. ADMIN Login
2. STUDENT Login
3. Logout
''')
op()
# Prompt the user to choose between admin and student login
def ch():
login_choice = input("Enter your choice: ")
if login_choice == '1':
pswd()

elif login_choice == '2':


student_login()

elif login_choice =='3':


print("LOGOUT SUCCESSFULLY!!!!!")

else:
print("Invalid choice.")
ch()
Screenshots
Python Output Screenshots

1) Logging In As Manager
2) Add Books
3) Issue Books
4) Sumit Books
5) Delete Books
#HERE WE CAN SEE FIRST THE BOOK NAMED “together with”, BUT IT IS
DELETED FROM NEW TABLES
6) Display Books
7) LOGOUT
8) Longing In As A STUDENT
9) Display books
10) Check Availability

11) View Issued Books


12) View Submitted Books

13) Logout
Database Tables Screenshots

TABLES USED:

Structures of the tables


Bibliography

1. Books
 Computer Science Class 12
Textbook By Preeti Arora

2. Websites
 www.cbse.nic.in

You might also like