PM-SHRI KENDRIYA
VIDYALAYA AZAMGARH
-INFORMATICS PRACTICES PROJECT-
--LIBRARY MANAGEMENT SYSTEM
Submitted By:
Name: Sanchit Kumar
Class & Stream: XI – Commerce
Roll No.: 08
Submitted To:
Mr. C. S. Singh
(Subject Teacher – Informatics
Practices) Academic Year:
2025–26
-CERTIFICATE
This is to certify that Sanchit
Kumar, a student of Class XI –
Commerce of PM-SHRI Kendriya
Vidyalaya Azamgarh, has
successfully completed the
Informatics Practices project titled
“Library Management System”
under the guidance and supervision
of Mr. C. S. Singh during the
academic year 2025–26.
*This project has been
developed with sincere effort
and reflects the student’s
understanding of programming
concepts, database
management, and their practical
application in solving real-world
problems related to library
operations.
SIGNATURE OF SUBJECT TEACHER:
SIGNATURE OF
PRINCIPAL:
-ACKNOWLEDGEMENT
I express my sincere
gratitude to my
Informatics Practices
teacher Mr. C. S. Singh
for his valuable guidance,
constant encouragement,
and support throughout
the completion of this
project.
I also thank PM-SHRI
Kendriya Vidyalaya
Azamgarh for providing
the necessary facilities
and learning environment.
This project would not
have been possible
without the support and
cooperation of all those
who contributed directly or
indirectly.
-INTRODUCTION
A Library Management
System is a computerized
system designed to
manage and maintain
library records efficiently.
It helps in storing
information related to
books, students, issue
and return records, and
library staff in a
structured manner. With
the increasing volume of
data in libraries, manual
record- keeping becomes
inefficient and error-
prone. Using Python
programming language
along with a
MySQL database, this
system automates
library operations and
ensures fast, accurate,
and secure data
handling.
-OBJECTIVE
The objectives of developing the
Library Management System
are:
•To understand the
practical use of Python
programming in real-life
applications
•To learn how Python interacts
with MySQL databases using
connectivity concepts
•To design a structured system
for managing books, users, and
transactions
•To reduce manual record-
keeping and improve
operational efficiency
•To ensure accuracy and
consistency in data storage and
retrieval
•To implement secure and
organized data handling
methods
•To make the system scalable for
future expansion
•To gain confidence in developing
usable software
-INPUT / OUTPUT
REQUIREMENTS (COMPLETELY
REDESIGNED – MODERN)
*Hardware Requirements:
•Operating System: Windows
10 / 11 or any modern Linux
distribution
•Processor: Intel Core i3 or
higher / AMD Ryzen
equivalent
•RAM: Minimum 8 GB
(recommended for database
handling)
•Storage: SSD or HDD with at
least 50 GB free space• Internet
Connection: Required for updates
and remote access
Software Requirements
•Python 3.10 or above
•MySQL Server 8.0 or above
•MySQL Connector for Python
•LibreOffice Writer (for
documentation)
•Any modern code editor (VS
Code / PyCharm
recommended)
-EXISTING SYSTEM
In the existing library system,
most records are maintained
manually using registers or basic
spreadsheet files. This method
requires significant time and effort
to record book details, issue
records, and return history.
Searching for a specific book or
student record becomes slow and
inefficient, especially as the size of
the library grows.
Manual systems are also highly
prone to human errors such as
incorrect entries, misplaced
records, and data loss. Updating
records regularly becomes
difficult, and maintaining accuracy
over a long period is challenging.
Due to the lack of automation,
reporting and tracking book
availability is unreliable, making
the system unsuitable for modern
library needs.
-PROPOSED SYSTEM
The proposed Library
Management System is a fully
computerized solution designed to
overcome the limitations of the
manual system. It uses Python for
application logic and MySQL for
secure and structured
data storage. The system
allows librarians to add,
update, search, and delete
book and user records
efficiently.
Automation reduces human errors
and improves accuracy in record-
keeping. Data retrieval becomes
fast and reliable, even for large
libraries. The system is designed
to be scalable and adaptable,
allowing future integration of
advanced features such as online
access, reporting tools, and multi-
user support. This makes the
proposed system efficient,
reliable, and suitable for real-
world deployment.
-SOURCE CODE
IMPORTS & GLOBAL
CONFIGURATION:
"""
ONLINE LIBRARY MANAGEMENT SYSTEM
Developed using Python & MySQL
Author : Sanchit Kumar
Class : XI – Commerce
Subject: Informatics Practices
"""
import [Link]
from [Link] import Error
import hashlib
from datetime import date
import sys
DATABASE CONFIGURATION:
class
DatabaseConfig:
HOST =
"localhost"
USER = "root"
PASSWORD =
"LIBRARY_PY+MYSQL"
DATABASE =
"online_library_management_system"
DATABASE CONNECTION
HANDLER:
class Database:
def init
(self): try:
[Link] = [Link](
host=[Link],
user=[Link],
password=[Link]
)
[Link] = [Link]()
self.setup_database()
except Error as e:
print("Database connection
failed:", e) [Link]()
def
setup_database(self):
[Link](
f"CREATE DATABASE IF NOT EXISTS
{[Link]
SE}"
)
[Link](f"USE {[Link]}")
[Link]("""
CREATE TABLE IF NOT EXISTS users (
user_id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50)
UNIQUE, password_hash
VARCHAR(255), role
VARCHAR(20)
)
""")
[Link]("""
CREATE TABLE IF NOT EXISTS books (
book_id INT AUTO_INCREMENT PRIMARY
KEY, title VARCHAR(100),
author VARCHAR(100),
category VARCHAR(50),
available BOOLEAN DEFAULT TRUE
)
"""
)
[Link]("""
CREATE TABLE IF NOT EXISTS members (
member_id INT AUTO_INCREMENT PRIMARY
KEY, name VARCHAR(100),
class VARCHAR(20),
contact VARCHAR(15)
)
"""
)
[Link]("""
CREATE TABLE IF NOT EXISTS transactions (
txn_id INT AUTO_INCREMENT PRIMARY KEY,
book_id INT,
member_id INT,
issue_date DATE,
return_date
DATE,
FOREIGN KEY (book_id) REFERENCES books(book_id),
FOREIGN KEY (member_id) REFERENCES
members(member_id)
)
"""
)
[Link]()
PASSWORD SECURITY &
AUTHENTICATION:
class Authentication:
def init (self,
db):
[Link] = db
def hash_password(self, password):
return hashlib.sha256([Link]()).hexdigest()
def register_user(self, username, password,
role): hashed = self.hash_password(password)
try:
[Link](
"INSERT INTO users (username, password_hash,
role) VALUES (%s, %s, %s)",
(username, hashed, role))
[Link]()
except:
print("User already exists.")
def login(self, username, password):
hashed =
self.hash_password(password)
[Link](
"SELECT role FROM users WHERE username=%s AND
password_hash=%s",
(username, hashed))
return [Link]()
BOOK MANAGEMENT
MODULE:
class BookManager:
def init (self,
db): [Link] = db
def add_book(self, title, author, category):
[Link](
"INSERT INTO books (title, author, category) VALUES
(%s,
%s, %s)",
(title, author, category))
[Link]()
print("Book added
successfully.")
def view_books(self):
[Link]("SELECT * FROM
books") books = [Link]()
for book in books:
print(book)
def search_book(self, keyword):
[Link](
"SELECT * FROM books WHERE title LIKE %s OR
author LIKE %s",
(f"%{keyword}%", f"%
{keyword}%")) for book in
[Link]():
print(book)
MEMBER MANAGEMENT
MODULE:
class
MemberManager:
def init (self,
db):
[Link] = db
def add_member(self, name, student_class, contact):
[Link](
"INSERT INTO members (name, class, contact)
VALUES (%s, %s, %s)",
(name, student_class, contact)
)
[Link]()
print("Member registered successfully.")
def view_members(self):
[Link]("SELECT * FROM
members") for member in
[Link]():
print(member)
ISSUE & RETURN TRANSACTIONS:
class
TransactionManager:
def init (self, db):
[Link] = db
def issue_book(self, book_id, member_id):
[Link](
"SELECT available FROM books WHERE book_id=%s",
(book_id,)
)
status = [Link]()
if status and status[0]:
[Link](
"INSERT INTO transactions (book_id, member_id,
issue_date) VALUES (%s, %s, %s)",
(book_id, member_id, [Link]())
)
[Link](
"UPDATE books SET available=FALSE
WHERE book_id=%s",
(book_id,)
)
[Link]()
print("Book issued
successfully.")
else:
print("Book not available.")
def return_book(self, book_id):
[Link](
"UPDATE transactions SET return_date=%s WHERE
book_id=%s AND return_date IS NULL",
([Link](), book_id)
)
[Link](
"UPDATE books SET available=TRUE WHERE book_id=
%s", (book_id,)
)
[Link]()
print("Book returned successfully.")
REPORTING & STATUS VIEW:
class Reports:
def init (self,
db): [Link] = db
def issued_books(self):
[Link]("""
SELECT [Link], [Link],
transactions.issue_date FROM transactions
JOIN books ON transactions.book_id =
books.book_id JOIN members ON
transactions.member_id =
members.member_id
WHERE transactions.return_date IS
NULL """)
for record in [Link]():
print(record)
MENU-DRIVEN MAIN PROGRAM:
def main():
db = Database()
auth = Authentication(db)
book_mgr = BookManager(db)
member_mgr = MemberManager(db)
txn_mgr = TransactionManager(db)
reports = Reports(db)
print("ONLINE LIBRARY MANAGEMENT SYSTEM")
while
True:
print(""
"
[Link] Book
2. View Books
3. Register Member
4. Issue Book
5. Return Book
6. View Issued Books
7. Exi
t """)
choice = input("Enter choice: ")
if choice == "1":
book_mgr.add_book(
input("Title: "),
input("Author: "),
input("Category: ")
)
elif choice == "2":
book_mgr.view_books()
elif choice == "3":
member_mgr.add_member(
input("Name: "),
input("Class: "),
input("Contact: ")
)
elif choice == "4":
txn_mgr.issue_book(
int(input("Book ID: ")),
int(input("Member ID: "))
)
elif choice == "5":
txn_mgr.return_book(
int(input("Book ID: "))
)
elif choice == "6":
reports.issued_books()
elif choice == "7":
print("Thank you for using the
system.") break
else:
print("Invalid choice.")
main()
-PROOFS
*Program Execution screenshot:
*Database Table screenshot:
-THANK YOU
I sincerely thank my teacher
Mr. C. S. Singh for his
guidance and encouragement
throughout the completion of
this project. This project was
not just an academic task, but
a valuable learning
experience that helped me
understand how technology
can solve real-life problems.