You are on page 1of 25

LIBRARY MANAGEMENT SYSTEM

PROJECT REPORT
SUBMITTED BY

PIYUSH GUPTA
DEEPAK PAREEK
GRADE: XII

VEDANTA ACADEMY
UTHUKULI
2023-2024
CERTIFICATE

This is to certify that candidate DEEPAK PAREEK

REG NO: __________________________ has successfully completed the

project Work entitled “Library Management System”

in the subject Computer Science (083) laid down in the regulations of CBSE for

the purpose of Practical Examination in Class XII to be held in VEDANTA

ACADEMY, UTHUKULI on ______________.

Staff In-charge

Internal Examiner External Examiner

Principal
ACKNOWLEDGEMENT

I would like to express my special thanks of gratitude to my teacher


Ms. K. S. Anandhi MCA, MA, B.Ed for constantly guiding and help me complete
this project with great excellence.

I would also like thank my Principal R.Sadana who gave me the golden
opportunity to do this wonderful project on the topic “Library Management
System”, which also helped me in doing a lot of research and I came to know about
so many new experiences and gave me lot of exposure to task completion through
programming languages.

Secondly I would also like to thank my parents and friends who helped me a lot in
finishing this project within the limited time.

I am making this project not only for marks but to increase my knowledge.

Thank you everyone who has led this project happen directly and indirectly. Thank
you everyone.
TABLE OF CONTENTS
S.NO CONTENT
1. Introduction
2. Imported files and modules used
3. Entity Relationship Diagram
4. System development Life Cycle
5. Coding
6. Output Screens
7. Limitations and Future
enhancements
8. Hardware requirements
9. Bibliography
INTRODUCTION:-
Library Management System

This Python program is designed to facilitate the management of a


library's book database. The system provides a menu-driven interface,
allowing users to perform various actions such as viewing, updating,
and adding information to the library's book records.

Key Features:
1. Displaying information: Users can view details about books in the
library, including serial numbers and specific column values.
2. Updating data: Users can modify existing information in the
database by selecting a book based on its serial number and providing
new values for specified columns.
3. Borrowers information: The system includes functionality to
manage information related to book borrowers.
4. System closure: Users have the option to close the system when
they have completed their tasks.

This code snippet handles a part of the program's logic, including user
input, database queries, and conditional branching based on user
decisions. It is part of a larger menu-driven system for efficient
library management.
Problems associated with manual
management
Library is approached by people for the satisfaction of their thirst of
knowledge. Current manual system of the library management is very
complicated and lengthy. A large number of registers are maintained in
order to maintain the list of students, books & their details & student’s
details.
As explained before library management system is a big complicated
system, therefore the problems associated with manual management are
listed below:

• Time consuming
• Non availability of details
• Decreased efficiency and accuracy
• Difficult & confusing
• Error in Maintenance

PROPOSED SYTEM
Library World wishes to computerize its management system with the
help of data base. It allows the librarian to update existing application for his
own ease like books account management, developing ledgers, issuing and
returning books etc. Also on the other face the reader/students wants to be
computerized solution of the above. It entails looking into the duplication of
effort, bottlenecks, and inefficient existing procedures.
An automated system is to be developed for library management system
that performs the following tasks:
➢ Issuing of books
➢ Returning of books
➢ Adding new books
➢ Maintains students Information.
➢ Providing Stock Management.
➢ Fast updating of stock
➢ Security
Modules used in the completion of program:-
1. mysql.connector:
• connect():- This function commands the connection
of python and MySQL server to be made.
• cursor():- This function enables a cursor pointer in
the command line client of the MySQL server
• execute():- This function is used to execute the query
which is given as its parameter, this query is
executed in MySQL server.
• fetchall():- This function with already a cursor
present fetches all the result of the query present in
the command line of MySQL .
• commit():- This function lets a user permanently
save all the changes made in the transaction of a
database or table.
Entry Relationship Diagram:-

NAME

CREATE AUTHOR

QUANTITY

SEARCH
START
CLOSE

VIEW
BY NAME

DISPLAY EVERY ENTRY


SYSTEM DEVELOPMENT LIFE
CYCLE:
The system development cycle, also known as the software
development life cycle (SDLC), is a series of phases that guide the
development of a software application from its initial concept to its
deployment and maintenance. Here's a simplified version of the
SDLC for the library management system you've implemented
The systems development life cycle consists of the following
activities:
1. Preliminary Investigation
2. Determination Requirements
3. Design of System
1.Preliminary Investigation:
For this, the need arises to understand the viewpoint of two important
entities, top management and users
In order to gather pertinent information, I interviewed the top
management and asked the following questions:
• How the present system works?
• What all drawbacks are in the present system?
• What is their vision about the new system?
• What specific facilities they want from new system,
those are currently not in scope of existing system?
• How will data flow in the system?
• Who will be authenticated to access data and his/her
access rights ?
After carrying out those interviews, I drew conclusion about the Top
Management’s requirements and whether users are in support of the
new system. This activity is consisting of three parts:-
1.Request Clarification
As previously staled, the requests are made from employees and user
in the organization, which are not clearly stated, therefore a system
investigating is being considered. The project request must be
examined to determine precisely what the originator wants.
2.Feasibility Study
Feasibility study tried to determine whether a given solution would
work or not. Its main objective is not to solve the problem, but to
acquire its scope. It focuses on following:
• Meet user requirements
• Best utilization of available resources
• Develop a cost effective system
• Develop a technically feasible system
2.Determination of System Requirement
Determination of system requirement means studying the adjacent
system in order to collect the details regarding the way it captures
data processes the data produces the output. I used following
techniques for identifying system requirements:
•Reviewing organization documents
•Onsite observations
•Conducting interviews
3. Design of System
A well-designed interface improves the user perception of the content
or services. It needs not to be flashy but it should be ergonomically
sound. Two main types of design interface, which I considered are:
•User Interface
•Communication Interface
a). User Interface
The various documents that are maintained by the RR section that
have been used to analyse the user interfaces that will interact with
the software. The software consists of many modules and these
modules consist of various sub modules, which provides the user with
various facilities.
b). Communication Interface
The software may either be installed on a client server based setup
with a Local Area Network (using the Ethernet Interface, one to one
connection and TCP/IP) or on a standalone machine whereby client
and server components resides on the same machine.
Coding: -
im port mysql.connector

# Connect to MySQL database


db = mysql.connector.connect(
host="localhost",
user="root",
password="root",
database="SCHOOL"
)

# Create a cursor object to interact with the database


cursor = db.cursor()

# Create a table to store books


cursor.execute("""
CREATE TABLE IF NOT EXISTS BOOK (
ID INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
author VARCHAR(255) NOT NULL,
Availablity VARCHAR(25) NOT NULL
)
""")

cursor.execute("""
CREATE TABLE IF NOT EXISTS receiveregister (
ID INT,
FOREIGN KEY (ID) REFERENCES BOOK(ID),
student_name VARCHAR(100) NULL,
student_ID VARCHAR(100) NOT NULL ,
STATE VARCHAR(10) NOT NULL,
Date DATE NOT NULL

)
""")
cursor.execute("""
CREATE TABLE IF NOT EXISTS issueregister (
ID INT,
FOREIGN KEY (ID) REFERENCES BOOK(ID),
student_name VARCHAR(100) NULL,
student_ID VARCHAR(100) NOT NULL ,
STATE VARCHAR(10) NOT NULL,
Date DATE NOT NULL

)
""")
db.commit()

def add_book(title, author, availability):


# Add a new book to the library
cursor.execute("INSERT INTO BOOK (title, author, Availablity) VALUES (%s, %s,
%s)", (title, author, availability))
db.commit()

def display_books():
# Display all books in the library
cursor.execute("SELECT * FROM BOOK")
books = cursor.fetchall()
if not books:
print("No books in the library.")
else:
print("ID | Title | Author | Availablity")
print("---------------------------------------------------------------")
for book in books:
print(f"{book[0]:<4}| {book[1]:<25}| {book[2]:<25}| {book[3]:<8}")

def search_book(title):
# Search for a book by title
cursor.execute("SELECT * FROM BOOK WHERE title LIKE %s", ('%' + title + '%',))
books = cursor.fetchall()
if not books:
print("Book not found.")
else:
print("ID | Title | Author | Availablity")
print("---------------------------------------------------------------")
for book in books:
print(f"{book[0]:<4}| {book[1]:<25}| {book[2]:<25}| {book[3]:<8}")
def display_records():
# Display all books in the library
cursor.execute("SELECT * FROM issueregister")
records = cursor.fetchall()
if not records:
print("No records in the library.")
else:
print("ISSUE REGISTER")
print("ID | Student name | Student ID | STATE ")
print("--------------------------------------------------------------------")
for record in records:
print(f"{record[0]:<4}| {record[1]:<25}| {record[2]:<25}| {record[3]:<8}")
cursor.execute("SELECT * FROM receiveregister")
records = cursor.fetchall()
if not records:
print("No records in the library.")
else:
print(" RECEIVE REGISTER")
print("ID | Student name | Student ID | STATE ")
print("--------------------------------------------------------------------")
for record in records:
print(f"{record[0]:<4}| {record[1]:<25}| {record[2]:<25}| {record[3]:<8}")
def bookissue(ID, sname, Sid, Date):
cursor.execute("INSERT INTO issueregister (ID, student_name, student_ID, Date, STATE
) VALUES (%s, %s, %s, %s, 'Issued')", (ID, sname, Sid, Date))
cursor.execute("UPDATE BOOK SET Availablity='no' WHERE ID=%s;", (ID,))
print("Successfully issued...")
db.commit()
def bookreceive(ID, sname, Sid, Date):
cursor.execute("INSERT INTO receiveregister (ID, student_name, student_ID, Date,
STATE ) VALUES (%s, %s, %s, %s, 'Received')", (ID, sname, Sid, Date))
cursor.execute("UPDATE BOOK SET Availablity='yes' WHERE ID=%s;", (ID,))
print("Successfully received...")
db.commit()
def main():
while True:
print("\nLibrary Management System")
print("1. Add Book")
print("2. Display Books")
print("3. Search Book")
print("4. Book Issued")
print("5. Book Recieved")
print("6.Show all records of books")
print("7.Quit")
choice = input("Enter your choice (1-7): ")

if choice == "1":
title = input("Enter the title of the book: ")
author = input("Enter the author of the book: ")
availability = input("Enter the availablity of the book: ")
add_book(title, author, availability)
print("Book added successfully.")

elif choice == "2":


display_books()

elif choice == "3":


title = input("Enter the title of the book to search: ")
search_book(title)

elif choice== "4":


Id=int(input("Enter the book ID : "))
sname=input("Enter the student name : ")
Sid=int(input("Enter the student ID :"))
Date=input("Enter the date in YYYY-MM-DD Format : ")
bookissue(Id,sname, Sid, Date)
print("Book is issued")
elif choice== "5":
Id=int(input("Enter the book ID : "))
sname=input("Enter the student name : ")
Sid=int(input("Enter the student ID :"))
Date=input("Enter the date in YYYY-MM-DD Format : ")
bookreceive(Id,sname, Sid, Date)
print("Book is Received")
elif choice=="6":
display_records()

elif choice == "7":


print("Exiting the program.")
break

else:
print("Invalid choice. Please enter a number between 1 and 4.")

if __name__ == "__main__":
main()
Output Screenshot:
Main Menu

Option 1 for the output


Option 2 , 3 and 4 for the output
Option 5, 6 and 7 for the output
TESTING
Testing is a process of executing the program with the intent of finding
errors and it establishes confidence that the program does what it is supposed to
do. Software Testing is an empirical investigation conducted to provide
stakeholders with information about the quality of the product or service under
test, with respect to the context in which it is intended to operate. Software
Testing also provides an objective, independent view of the software to allow
the business to appreciate and understand the risks at implementation of the
software.
It can also be stated as the process of validating and verifying that a software
program/application/product meets the business and technical requirements that
guided its design and development, so that it works as expected and can be
implemented with the same characteristics. Software Testing, depending on the
testing method employed, can be implemented at any time in the development
process, however the most test effort is employed after the requirements have
been defined and coding process has been completed.
Software testing methods are traditionally divided into black box testing and
white box testing. These two approaches are used to describe the point of view
that a test engineer takes when designing test cases.
Black Box Testing:
Black box testing treats the software as a "black box," without any knowledge
of internal implementation. Black box testing methods include: equivalence
partitioning, boundary value analysis,
all-pairs testing, fuzz testing, model-based testing, traceability matrix,
exploratory testing and specification-based testing.
The black box tester has no "bonds" with the code, and a tester's perception is
very simple: a code must have bugs. Using the principle, "Ask and you shall
receive," black box testers find bugs where programmers don't. But, on the other
hand, black box testing has been said to be "like a walk in a dark labyrinth
without a flashlight," because the tester doesn't know how the software being
tested was actually constructed.
That's why there are situations when (1) a black box tester writes many test
cases to check something that can be tested by only one test case, and/or (2)
some parts of the back end are not tested at all. Therefore, black box testing has
the advantage of "an unaffiliated opinion," on the one hand, and the
disadvantage of "blind exploring," on the other.
White Box Testing:
White box testing, by contrast to black box testing, is when the tester has access
to the internal data structures and algorithms (and the code that implement
these).
White box testing methods can also be used to evaluate the completeness of a
test suite that was created with black box testing methods. This allows the
software team to examine parts of a system that are rarely tested and ensures
that the most important function points have been tested.
LIMITATIONS OF THE FOLLOWING
CODE: -
• Security Concerns
• No user authentication
• Scalability

Future Enhancements: -
• User management
• Search and Filtering
• Transaction management
• Logging
• Notification System
• Web interface
• Cloud Integration
• Data Validation
HARDWARE AND SOFTWARE
REQUIREMENTS
Hardware Requirements:
• Processor - Intel® Atom™ CPU Z3735F @ 1.33 GHz
• RAM - 2.00 GB
• Keyboard
• Mouse

Software Requirements:
• Windows 10
• OS.build - 15063.1418 32 bit
• Python IDLE
• MySQL
1. www.slideshare.net
2. www.geeksforgeeks.org
3. www.google.com
4. Computer Science with Python
by Sumita Arora Class XII

You might also like