Table of Content
Table of Content
1. Introduction 02
2. Flow chart 04
3. Python Overview 05
4. Table Used 09
6. Source Code 15
7. Output 18
8. Limitation 20
9. Requirements 22
10. Bibliography 23
INTRODUCTION
The system is built using Python, a highly versatile and popular programming language
known for its readability and wide applicability in software development. Python’s
compatibility with various libraries and frameworks makes it an ideal choice for
developing scalable and efficient software. Additionally, the system integrates with a
relational database that ensures the secure and organized storage of all library data. By
combining these technologies, the Library Management System offers a robust platform
capable of meeting the needs of both small and large libraries.
One of the most significant benefits of this automated system is its ability to drastically
reduce human error. In manual systems, errors in data entry or record management are
common, leading to miscommunication, delays, and even the loss of important
information. By automating these processes, the Library Management System ensures
that data is entered correctly, stored efficiently, and easily retrieved whenever needed.
Librarians and staff no longer need to spend hours updating records, generating reports,
or manually tracking overdue notices. The system can handle these tasks automatically,
freeing up valuable time and resources that can be better spent on more critical functions
such as assisting library users or organizing library events.
Designed with ease of use in mind, this Library Management System requires no
advanced technical knowledge to operate. The interface is simple, intuitive, and
accessible, allowing librarians and users alike to navigate the system with ease.
Integrated validation checks prevent the entry of incorrect or inconsistent data, offering
real-time feedback and ensuring that the information entered into the system is always
accurate. In cases where errors do occur, the system provides clear, user-friendly
messages that guide users in correcting the mistake. This attention to detail ensures that
all records are kept up-to-date and error-free.
In today's fast-paced world, libraries must manage vast amounts of information,
including books, journals, membership details, librarian records, and more.
Efficient management of this information is crucial for any library, whether it is part of
2
an educational institution, a corporate setting, or a public service. This Library
Management System is specifically designed to meet the diverse and complex
requirements of modern libraries. It provides instant access to critical information,
aiding librarians in making informed decisions regarding resource allocation, member
services, and operational strategies.
Furthermore, the system offers a high degree of flexibility through its remote access
functionality. Librarians and administrators can access and manage the system from any
location, allowing them to monitor library operations and handle administrative tasks
even when they are not physically present in the library. This capability significantly
enhances the convenience and operational efficiency of the system, making it a valuable
tool for libraries that serve large or geographically dispersed populations.
FLOW CHART
3
PYTHON OVERVIEW
Python is a high-level, interpreted programming language know for its simplicity and
4
readability. It was created by Guido van Rossum and first released in 1991. Here’s an
overview of Python
1.General Characteristics
●Easy to Learn and Use: Python's syntax is clear and intuitive, making it accessible for
beginners while still powerful enough for experts.
●Interpreted Language: Python code is executed line by line, which makes debugging
easier and enhances the development process.
●Dynamically Typed: Python does not require explicit declaration of variable types; the
type is determined at runtime, adding flexibility
2.Features of Python
●Simple Syntax: Python’s straightforward syntax promotes readability and reduces the
cost of program maintenance.
●Rich Standard Library: Python comes with a comprehensive standard library that
provides built-in modules and functions for various tasks.
●Web Development: Building web applications with frameworks like Django and Flask.
●Data Science and Analytics: Analyzing and visualizing data using libraries like Pandas
and Matplotlib.
4.Disadvantages
●Speed: Python is generally slower than compiled languages like C or Java due to its
interpreted nature.
●Memory Consumption: Python may consume more memory, which can be an issue in
resource-constrained environments.
3.Concatenation: Strings can be combined using the + operator, creating a new string.
1.Mutable: Lists can be modified, allowing for the addition, removal, or alteration of
items.
4.Built-in Methods: Lists come with various built-in methods, such as append(),
remove(), and sort().
7
2.Immutability: Once created, tuples cannot be modified, ensuring data integrity.
4.Memory Efficiency: Tuples consume less memory than lists, making them more
efficient for storing fixed collections of items.
5.Usage as Keys: Tuples can be used as keys in dictionaries due to their immutability.
2.Key-Value Pairs: Each entry in a dictionary consists of a unique key and its associated
value.
TABLE USED
8
DATABASE DESIGN:
The Library Management system use a MySQL database to store data and information.
TABLE DESCRIPTIONS:
Books: This table stores information about different books in the library. It includes the
following fields:
SYSTEM FUNCTIONALITY:
• Add Book:
This feature allows users to add new books to the library's collection by entering all
relevant details, such as the book number, title, author, publication year, and price. This
ensures that all books are accurately recorded and easily retrievable.
• View Books:
The system enables users to view a complete list of all books currently available in the
library. Each entry includes essential information like the book number, name, author,
and price, allowing users to quickly check the availability and details of any book.
• Delete Book:
Users can remove a book from the library's catalog using the Delete Book option. To do
this, users must provide the unique book number, which helps ensure that only the
correct record is removed from the system.
DESCRIPTION OF CONNECTIVITY:
A critical aspect of the Library Management System is its ability to connect to a MySQL
10
database for efficient storage and management of library data. Below is a detailed
explanation of how the system connects to MySQL and how it interacts with the
database to perform essential operations:
A connection object is created, which acts as a link between the Python program and the
MySQL server. This connection object is essential for performing any database
operations, such as creating tables, adding records, or retrieving data. The successful
creation of this connection is the foundation for all subsequent interactions with the
database.
• Commit Changes:
Whenever a query modifies the database, such as adding a new book or updating a
book's price, it is essential to commit the changes. The commit() method ensures that all
modifications are saved to the database. Without this step, changes made during the
current session would be lost once the connection is closed.
Committing changes is particularly important in a multi-user environment where
multiple staff members may be accessing the system simultaneously. By committing
changes, the system ensures that all updates are applied consistently, avoiding data
conflicts or overwrites.
12
1.create_database(x)
Purpose: Creates the necessary database and table to store library data.
Details:
Database and Table Creation: Connects to MySQL to create a database and a BOOKS
table if they don’t exist, defining columns for Book Number, Name, Author, Year
Published, and Price.
Primary Key: Sets BOOK_NO as the primary key to prevent duplicate records.
Error Handling: If the database already exists, skips creation and shows a message.
Importance: Establishes the structure required for all library operations.
3. view_books()
Purpose: Retrieves and displays the current list of all books in the library.
Details:
Data Retrieval: Uses a SELECT * FROM BOOKS command to fetch all book records.
Display Format: Prints each book's details in a user-friendly layout.
Importance: Provides a quick way to view the entire library collection.
4. delete_book(Book_No)
5. updating_bookprice(Book_No, Price)
13
Purpose: Updates the price of a specific book in the database.
Details:
Data Update: Uses an UPDATE SQL command to modify the book price based on Book
Number.
Confirmation: Confirms that the book price has been updated.
Importance: Ensures price accuracy for financial management.
6. main()
Purpose: Acts as the main user interface, providing access to all functions.
Details:
Menu Interface: Displays a menu for adding, viewing, deleting, or updating books.
Looped Execution: Runs in a loop for continuous operations until the user exits.
Importance: Offers a simple, menu-driven interface for easy access to library
functionalities.
SOURCE CODE:
14
import mysql.connector
print("*Enter the database name which is not alreay exists in mysql*")
a=input("Enter the database to create:")
def create_database(x):
try:
con=mysql.connector.connect(host="localhost",username="root",password
="12345")
cursor=con.cursor()
Query="CREATE DATABASE {}".format(a)
cursor.execute(Query)
Qu="USE {}".format(a)
cursor.execute(Qu)
Q="CREATE TABLE BOOKS(BOOK_NO INT primary key,BOOK_NAME
VARCHAR(30),AUTHOR VARCHAR
(30),YEAR_PUBLISHED INT,PRICE INT)"
cursor.execute(Q)
con.commit()
con.close()
print("Database created successfully:",a)
except:
print("Database already exists")
create_database(a)
def add_book(Book_No,Book_Name,Author,year_published,Price):
global a
con=mysql.connector.connect(host="localhost",username="root",password=
"12345",database=a)
cursor=con.cursor()
Query="INSERT INTO BOOKS VALUES({},'{}','{}',{},{})".format
(Book_No,Book_Name,Author,year_published,Price)
cursor.execute(Query)
con.commit()
con.close()
print("Book added successfully")
def view_books():
global a
con=mysql.connector.connect(host="localhost",username="root",
password="12345",database=a)
cursor=con.cursor()
Query="SELECT * FROM BOOKS"
15
cursor.execute(Query)
books=cursor.fetchall()
print("Books in the library:")
for i in books:
print("===================")
print("Book_ID=",i[0])
print("Book_Name=",i[1])
print("Author=",i[2])
print("year_published=",i[3])
print("Book_Price=",i[4])
print("====================")
def delete_book(Book_No):
global a
con=mysql.connector.connect(host="localhost",username="root",
password="12345",database=a)
cursor=con.cursor()
Query="DELETE FROM BOOKS WHERE Book_No=%s"%(Book_No)
cursor.execute(Query)
con.commit()
con.close()
print("Book deleted successfully")
def updating_bookprice(Book_No,Price):
global a
con=mysql.connector.connect(host="localhost",username="root",
password="12345",database=a)
cursor=con.cursor()
Query="UPDATE BOOKS SET PRICE=({}) WHERE BOOK_NO=({})"
.format(Price,Book_No)
cursor.execute(Query)
con.commit()
con.close()
print("Book Price updated successfully")
def main():
global a
con=mysql.connector.connect(host="localhost",username="root",
password="12345",database=a)
if con is None:
return
while True:
16
print("=========LIBRARY MANAGEMENT SYSTEM=========")
print("1. Add Book")
print("2. View Book")
print("3. Delete Book")
print("4. Updating price")
choice=int(input("Enter your choice:"))
if choice==1:
Book_No=int(input("Enter Book number:"))
Book_Name=input("Enter book name:")
Author=input("Enter Author name:")
year_published=int(input("Enter book published year:"))
Price=int(input("Enter the book price:"))
add_book(Book_No,Book_Name,Author,year_published,Price)
elif choice==2:
view_books()
elif choice==3:
Book_No=int(input("Enter the book number to delete:"))
delete_book(Book_No)
elif choice==4:
Book_No=int(input("Enter book number to change book price:"))
Price=int(input("Enter book price to change:"))
updating_bookprice(Book_No,Price)
main()
17
OUTPUT
Main Menu
Add Book
View Books
18
Delete Book
19
LIMITATIONS
While significant efforts have been made to develop a user-friendly and efficient Library
Management System, certain limitations are inevitable due to time, resource, and logical
constraints. The system provides a broad range of functionalities designed to meet the
core needs of library operations; however, the inclusion of more complex or advanced
features was restricted by various factors, including the need to focus on core
functionality, thorough testing, and refinement within the available time frame. As with
any software system, it is essential to acknowledge the limitations to ensure realistic
expectations for its performance and capabilities.
Below is a detailed list of limitations for the Library Management System:
• Cost of Implementation: Deploying a Library Management System, particularly for
smaller libraries or institutions with limited budgets, can involve substantial initial costs.
The implementation process requires investment in both software and hardware
infrastructure. In addition to purchasing or licensing the software, the library may need
to upgrade existing computer systems, network infrastructure, and databases.
Furthermore, staff members will require training to effectively use the system, which
can add to the overall costs. For small or underfunded libraries, these expenses may pose
significant challenges.
• Data Security Risks: As the system manages and stores sensitive data—such as book
records, member details, and transaction history—it becomes a target for potential
security threats. Without comprehensive security measures such as encryption, regular
updates, and access control protocols, the system could be vulnerable to data breaches,
unauthorized access, or cyber-attacks. Inadequate security could lead to the exposure of
private information, disrupting operations and damaging the trust between the library
and its users. The implementation of strong security practices is critical, but often
complex and costly to maintain.
• Complexity of Use and Implementation: The initial deployment and configuration of
the system may pose challenges for some users, especially in libraries that are new to
digital management systems. The system may require significant setup time and
configuration before it is fully operational. Furthermore, end users—such as library staff
or administrators—may need comprehensive training to understand how to navigate the
system, perform daily tasks, and troubleshoot common issues. The learning curve
associated with new software can temporarily disrupt normal library operations,
reducing efficiency during the transition period.
20
• Limited Advanced Features: While the Library Management System effectively
handles core functions such as book cataloging, member registration, and transaction
tracking, certain advanced features were not included in this version due to time and
resource constraints. For example, online cataloging capabilities, integration with
external or third-party databases, or an automated system for managing inter-library
loans are not available in this version. These features, while highly beneficial, require
additional development time, specialized resources, and complex coding, which could
not be accommodated within the project scope.
21
REQUIREMENT
HARDWARE REQUIRED:
● Modern Operating System:
1) Windows 7 or 10
2) Mac Os X 10,11 or higher 64 bit
3) Linux: RHEL 6/7 64-bit
● X86 64-bit CPU
● 4 GB RAM
● 5 GB free space
● Printer for printing projects
SOFTWARE REQUIRED:
● Operating System-Windows 10
● Python 3.75
● Msword, for perparring documentation
22
BIBLOGRAPHY
●www.wikipedia.com
●www.slideshare.com
●www.Geeksforgeeks.org
●www.gogle.com
●Computer Science With Python by Sumita Arora Class XII(Book)
23