0% found this document useful (0 votes)
5 views32 pages

CS Project

Prakhar Tripathi completed a Computer Science project titled 'Library Management System' under the guidance of Mr. Prabanjan Kumar for the academic year 2024-25, demonstrating dedication and timely completion. The project aims to automate library operations, allowing users to manage books, issue and return them, and includes features like user authentication and a user-friendly interface. The document also outlines the hardware and software requirements, provides an overview of Python, and includes the source code for the project.
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)
5 views32 pages

CS Project

Prakhar Tripathi completed a Computer Science project titled 'Library Management System' under the guidance of Mr. Prabanjan Kumar for the academic year 2024-25, demonstrating dedication and timely completion. The project aims to automate library operations, allowing users to manage books, issue and return them, and includes features like user authentication and a user-friendly interface. The document also outlines the hardware and software requirements, provides an overview of Python, and includes the source code for the project.
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/ 32

Certificate

This is to certify that Prakhar Tripathi


of
Class XII ‘B’ has completed his
Computer Science project Library
Management system
under the guidance of Mr. Prabanjan
Kumar
for the academic year 2024-25.
The certified student has been
dedicated
throughout his research and completed
his
work before the given deadline without
missing
any important details from the project.
It is also certified that this project is the
individual work of the student and can
be
submitted for evaluation.
Acknowledgem
ent
Internal Principal External

Page 1
I would like to take this opportunity to
extend my sincere gratitude and
appreciation to my Computer Science
teacher
Mr. Prabanjan Kumar for providing
guidance and support throughout the
process of completing my computer
project for school. I am also thankful to
my
principal Mrs. Paramjeet Kaur for
allowing me the opportunity to explore
and work on this project in the school
environment. Additionally, I would like
to express my heartfelt thanks
to my family and friends for their
unwavering support and
encouragement
during the completion of this project.

Index Page 2

1. Certificate___________1
2. Acknowledgement___________2
3. Index___________3
4. About Project___________4-6
5. Hardware and Software
Requirement_7
6. About Python___________8-13
7. Source Code___________14-20
8. Sample Output___________21-25
9. Future Scopes___________26-29
10. Conclusion___________30
11. Bibliography___________31

Page 3
Introducti
on
The project LIBRARY MANAGEMENT SYSTEM
(DIGITAL LIBRARY) includes enrolment of users,
adding of books into the library system. The
software has the facility to search for news,
Wikipedia articles. It includes an authentication
facility for admin and user to login into the admin
panel and user panel resp. of the system. User
can see the books available, details of books
issued by the user in the digital library. The
Library Management System can be login using a
user ID and password. It is accessible either by
an admin or user. Only the admin can add, delete
and update the data of users and books into the
database. The data can be retrieved easily. The
interface is very user-friendly. The data are well
protected for personal use and makes the data
processing very fast.
The purpose of the project entitled as “DIGITAL
LIBRARY” is to computerize the Front Library
Management to develop software which is user
friendly, simple, fast, and cost effective. It also
has a notes facility where the user can add notes
at any point of the program into the database.

Library
A library is a collection of books, and possibly
other materials and media, that is accessible for
use by its members and members of allied
institutions. Libraries provide physical or digital
materials, and may be a physical location, a
virtual space, or both. A library's collection
normally includes printed materials which may be
borrowed, and usually also includes a reference
section of publications which may only be utilized
inside the premises. Libraries can vary widely in
size and may be organised and maintained by a
public body such as a government, an institution
(such as a school or museum), a corporation, or a
private individual. In addition to providing
materials, libraries also provide the services of
librarians who are trained experts in finding,
selecting, circulating and organising information
while interpreting information needs and
navigating and analysing large amounts of
information with a variety of resources.
Library Management
System
Page 5

A Library Management System (LMS) is


an automated enterprise resource
planning tool that streamlines library
operations, such as tracking users,
books, issued and returned books, and
fines. It helps manage libraries
efficiently and reduces operational costs
by minimizing manual tasks, paperwork,
and saving time for both users and
librarians. The system allows users to
search for available books with just a
click, simplifies queries about book
availability, and makes adding,
removing, or editing the database easy.
It also enables quick user management,
such as adding or cancelling
memberships, making library

Page 6
management more streamlined and
efficient.

Hardware and Software


Requirements

Hardware Requirements for


Python:
 Processor: Any modern CPU (Intel, AMD)
 RAM: 4GB (minimum), 8GB or more
recommended
 Storage: SSD preferred for faster
performance
 Operating System: Windows, macOS, Linux

Software Requirements for


Python:
 Python Interpreter: Version 3.6 or higher
 IDE/Text Editor: Visual Studio Code, PyCharm,
or any text editor like Sublime Text, Atom
 Libraries: NumPy, Pandas, Matplotlib, Django,
Flask (depending on needs)
About Python Page 7

Python: Overview and Key


Features
What is Python?
Python is a versatile, easy-to-learn
programming language used for web
development, data analysis, artificial
intelligence, and automation. Its simple
syntax and dynamic nature make it
accessible to both beginners and
experienced developers.

Key Features of Python


 Easy to Learn and Use: Python’s simple
syntax resembles plain English, making it
ideal for beginners.
 Open-Source and Free: Python is freely
available for download, with an open-source
nature that allows modification and
redistribution.
 Portable and Platform-Independent: Python
code runs seamlessly across different
platforms without requiring changes.
 Extensive Libraries: Python offers a vast
collection of libraries for web development,
data analysis, machine learning, and more.
Page 8
 Dynamic Typing: Variables in Python do not
need explicit data type declaration, making
coding faster and more flexible.

Applications of Python
Python is widely used in various fields:
 Web Development
 Data Science
 Machine Learning and AI
 Automation
 Game Development

Python Basics
Syntax
 Python’s syntax is straightforward and uses
indentation to define code blocks.
Variables and Data Types
 Python variables are containers that store
data values. The data type is determined
automatically. Page 9

Input and Output


 Python allows interaction through input and
output.

Control Structures
Conditional Statements
Conditional statements help the program make
decisions based on conditions. Python uses if,
elif, and else.
Loops
Loops execute a block of code multiple times.
Python provides for and while loops.

Functions
What are Functions?
Functions are reusable blocks of code that
perform specific tasks, helping organize and
avoid code repetition.
Creating and Calling Functions
 Functions are called by their name followed
by parentheses, optionally passing
arguments.
Advantages of Functions
 Modularity: Breaks code into smaller,
manageable parts.
 Reusability: Functions can be reused across
different parts of a program.
 Improved Code Organization: Makes code
easier to read and maintain.

Working with Files


File Handling Basics
 Python provides built-in functions to handle
files: create, read, update, delete.
Common File Modes
 r: Read-only mode
 w: Write mode (overwrite)
 a: Append mode
 r+: Read and write mode
Working with CSV Files
 Python’s csv module helps manage CSV files.

Page
11
Python Libraries
Python has a rich ecosystem of built-in libraries
that make programming efficient.

Python-SQL Connectivity
Introduction
Python supports database connectivity using
libraries like mysql.connector. SQL is used to
manage relational databases.
Steps for Python-SQL Connectivity
1.Import the Database Module
2.Establish a Connection
3.Create a Cursor Object
4.Execute SQL Queries
5.Fetch Results
6.Close the Connection

Conclusion
Page
12
Python is a versatile and beginner-friendly
programming language, known for its simplicity,
readability, and powerful libraries. It’s suitable
for web development, data analysis, machine
learning, automation, and more. With its rich
features and ease of learning, Python is an
excellent choice for programmers at all levels.

Source
Code Page
13

#LIBRARY MANAGEMENT SYSTEM


import mysql.connector
# Connect to MySQL database
mydb = mysql.connector.connect(host='localhost', user='root',
passwd='1234')
mycursor = mydb.cursor()
print("""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WELCOME TO MY PROJECT [ LIBRARY MANAGEMENT SYSYEM ]
This project is made by >PRAKHAR TRIPATHI< of XII-B
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
""")
# Creating Database
mycursor.execute("CREATE DATABASE IF NOT EXISTS library_1")
mycursor.execute("USE library_1")
# Creating Tables
mycursor.execute("""
CREATE TABLE IF NOT EXISTS available_books (
ID INT,
NAME VARCHAR(25),
SUBJECT VARCHAR(25),
QUANTITY INT
)
""")
mycursor.execute("""
CREATE TABLE IF NOT EXISTS issued (
ID INT,
NAME VARCHAR(25),
SUBJECT VARCHAR(25),
Page
S_Name VARCHAR(25), 14
S_Class VARCHAR(25)
)
mycursor.execute("""
CREATE TABLE IF NOT EXISTS login (
USER VARCHAR(25),
password VARCHAR(25)
)
""")
mydb.commit()

# Entering initial data if the login table is empty


flag = 0
mycursor.execute("SELECT * FROM login")
for i in mycursor: # To know if table is empty or not
flag = 1
if flag == 0: # Table is empty
mycursor.execute("INSERT INTO login VALUES ('user',
'ng')")
mydb.commit()

# Main program loop


while True:
print("1.Login \n2.Exit")
ch = int(input("Enter your CHOICE : "))
if ch == 1:
pas = input("Enter the PASSWORD : ")
mycursor.execute("SELECT * FROM login")
for i in mycursor:
t_user, t_pas = i
Page
if pas == t_pas:
15
print("Correct password \nLogin Successfully")
loop1 = 'n'
while loop1 != 'y':
print("""
1.ADD new Book
2.REMOVE any Book
3.ISSUE book to a student
4.Return Book
5.VIEW available Books
6.VIEW issued books
7.Logout
""")
if ch == 1: # ADD new Book
loop2 = 'y'
while loop2 != 'n':
print("Please enter all the details of
the BOOK :")
idd = int(input("Enter the Book Id :
"))
name = input("Enter the Book Name : ")
subject = input("Enter SUBJECT : ")
quan = int(input("Enter Quantity : "))
mycursor.execute("INSERT INTO
available_books VALUES
('" + str(idd) + "', '" + name + "',
'" + subject + "',
'" + str(quan) + "')")
mydb.commit()
print("Data inserted
Successfully....")
Loop2 = input("Do you want to add
another book [y/n] : ").lower() Page
16

loop1 = input("Do you want to log out


[y/n] : ").lower()
elif ch == 2: # REMOVE any Book
idd = int(input("Enter ID to REMOVE book :
"))
mycursor.execute("SELECT * FROM
available_books")
flag = 0
for i in mycursor:
t_id, t_name, t_subject, t_quan = i
if t_id == idd:
flag = 1
if flag == 1:
mycursor.execute("DELETE FROM
available_books WHERE
id='" + str(idd) + "'")
mydb.commit()
print("Book is successfully deleted")
else:
print("Book is not available")
elif ch == 3: # ISSUE book to a student
idd = int(input("Enter the Book ID : "))
s_name = input("Enter the NAME of student
: ")
s_class = input("Enter student CLASS : ")
mycursor.execute("SELECT * FROM
available_books WHERE ID = '" + str(idd) +
"'")

flag = 0
for i in mycursor:
Page
t_id, t_name, t_subject, t_quan = i
17
flag = 1
if flag == 1:
if t_quan > 0:
quan = t_quan - 1
mycursor.execute("INSERT INTO
issued VALUES ('" + str(idd) +
"','" + t_name + "','" +
t_subject +"','" + s_name +
"','" + s_class + "')")
mycursor.execute("UPDATE
available_books SET
QUANTITY = '" + str(quan) + "'
WHERE ID = '" +str(idd) + "'")
mydb.commit()
print("Book issued successfully.")
else:
print("Book not available in
stock.")
else:
print("Book ID not found in the
database.")
elif ch == 4: # Return Book
idd = int(input("Enter Book ID : "))
s_name = input("Enter Student NAME : ")
s_class = input("Enter the CLASS : ")
mycursor.execute("SELECT * FROM issued")
flag = 0
for i in mycursor:
t_idd, t_name, t_subject, t_s_name,
t_s_class = i
if t_idd == idd and t_s_name ==
Page
s_name and t_s_class ==
18
s_class:
flag = 1
if flag == 1:
mycursor.execute("SELECT * FROM
available_books WHERE
id='" + str(idd) + "'")
for i in mycursor:
t_id, t_name, t_subject, t_quan =
i
quan = t_quan + 1
mycursor.execute("DELETE FROM issued
WHERE id='" +str(idd) + "' AND
S_Name='" + s_name + "' AND
S_Class='" + s_class + "'")
mycursor.execute("UPDATE
available_books SET QUANTITY ='" +
str(quan) + "' WHERE ID = '" +
str(idd) + "'")
mydb.commit()
print("Book returned successfully.")
else:
print("Book has not been issued yet.")
elif ch == 5: # VIEW available Books
mycursor.execute("SELECT * FROM
available_books")
print("ID | NAME | SUBJECT | QUANTITY")
for i in mycursor:
a, b, c, d = i
print(f"{a} | {b} | {c} | {d}")

elif ch == 6: # VIEW issued books


Page
mycursor.execute("SELECT * FROM issued")
19
print("ID | NAME | SUBJECT | S_NAME |
S_CLASS")
for i in mycursor:
a1, a2, a3, a4, a5 = i
print(f"{a1} | {a2} | {a3} | {a4} |
{a5}")
elif ch == 7: # Logout
break
else:
print("Wrong password \nAccess denied")

elif ch == 2:
break

Output Page
20
To add a new book:
Page
21
Remove any book:

Page
22
Issue book to a
student:

To return a book:
Page
23
To view available
books:

Page
24
To view issued books:

Logout:

Page
25
Future Scope of Library
Management System0
Future Scope of Library Management
System
The Library Management System (LMS) has
significant potential for future enhancements and
applications. Here are the key areas of its future
scope:
1. Integration with Advanced Technologies
 Cloud-Based System:
o Store data on cloud servers to enable
real-time access and collaboration for
users and administrators from any
location.
 AI and Machine Learning:
o Provide personalized book
recommendations based on users'
borrowing history.
o Implement chatbots to assist users with
queries and book searches.
 IoT Integration:

Page
26
o Utilize RFID technology for efficient book
tracking, automated check-in/check-out,
and inventory management.

2. Enhanced User Experience


 Mobile Application Support:
o Develop mobile apps to allow users to
search catalogs, check availability, and
track their borrowing status on the go.
 Multi-Language Interface:
o Support multiple languages to cater to a
diverse user base.
 Advanced Search Functionality:
o Incorporate Natural Language Processing
(NLP) for intuitive and accurate search
results.

3. Automation and Efficiency


 Automated Notifications:
o Send reminders for due dates, overdue
books, or library events through email or
SMS.
 Self-Service Systems:

Page
27
o Implement self-service kiosks for
borrowing and returning books
independently, reducing manual
intervention.
 Digital Library Integration:
o Expand the system to include e-books,
journals, and other digital resources for a
comprehensive digital library experience.

4. Data Analysis and Insights


 Usage Analytics:
o Analyse borrowing trends to understand
user preferences and improve library
inventory.
 Reporting Tools:
o Generate detailed reports on library
usage, overdue books, and popular
genres for efficient decision-making.

5. Scalability and Security


 Scalable Architecture:
o Design the system to handle a growing
number of users and books as the library
expands.
 Enhanced Security:
Page
28
o Incorporate data encryption and user
authentication to ensure secure access
and prevent unauthorized usage.

The future scope of the Library Management


System lies in its ability to evolve into a smarter,
more efficient, and user-friendly platform by
integrating advanced technologies and catering
to the changing needs of modern libraries.

Conclusion Page
29
The Library Management System project serves as a
practical implementation of software development
principles, highlighting the importance of efficient data
management in libraries. Through this project, we have
developed a system that simplifies library operations
such as book issuance, returns, and inventory tracking.
The system ensures accuracy, reduces manual
workload, and provides a user-friendly interface for
both library staff and users. By incorporating features
like automated records and real-time updates, the LMS
demonstrates its capability to streamline traditional
library processes.
This project has also laid the foundation for future
enhancements, such as integrating advanced
technologies like cloud computing, artificial intelligence,
and digital libraries, making it scalable and adaptable
to modern library needs.
In conclusion, the Library Management System is a
step towards digitizing libraries, improving their
efficiency, and enhancing user experience, showcasing
the practical applications of computer science in
solving real-world problems.

Bibliography Page
30
1. Computer Science with Python Book by
Sumita Arora
2. Google
3. ChatGPT
4. GitHub

Page
31

You might also like