IP Synopsis Uddipan

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Acknowledgement

It gives me immense pleasure to present the Project on Informatics Practices,


titled “Library Management System”. I would like to express my gratitude towards
my teacher in charge, Mr. Sarujit Dew under whose guidance and constant supervi-
sion the project has been completed. The instrutions and suggestions given by them
have been a major contributor towards the completion of the project.

I would also like to thank our Principal Father Benoy Joseph for his caring and
encouraging attitude towards us. I look forward to receive valuable suggestions from
peers, teachers and viewers too.

Thank You

Name: Uddipan Kashyap


Class: XII - Science
CERTIFICATE

This is to certify that Uddipan Kashyap bearing the Roll No.: __________________
is a student of Class XII - Science. He has successfully completed his Informatics Prac-
tices project titled Library Management System as per the guidelines of Central Board
of Secondary Education for the academic year 2023-2024.

It is further certified that this project is the individual and bonafide work of the candi-
date.

Principal Signature: _____________________________________________________

Teacher’s Signature: _____________________________________________________

External’s Signature: _____________________________________________________











PROPOSED SYSTEM
All the four activities of systems have been automated and efforts have been
made to minimize the manual working. Benefits Of Purposed System:-

1. Less Paper Work


The paper work is reduced to minimal level. Computer prepares the lists of
customers.

2. No Manual Work:
There is no manual work. All the processes are done through computer.

3. Record of users:
There is record of all the users who got registered.

4. Register Maintenance is Easier:


Register can now easily be maintained by producing a report with a format of
adding students records.

5. Data Is Not Scattered:


Data is now stored at one place. Any information regarding anything can be
easily available to the user.

6. User-friendly Software:
The software is be menu-driven and is very easy to use.

7. Flexibility:
The system is more flexible than the manual system being used presently.

8. Beneficial:
The system is easy to use and reduces the users workload a lot. It provides
timely and accurate information and there is automatic generation of reports.
FEASIBILITY STUDY
During the course of completion of this project work, the complete analysis
of prposed system was done. In the analysis task, a complete care about the
feasibility of the proposed system was taken. The following feasibility anal-
yses were carried out during the course of this project work on call manage-
ment system for customer care:

1. Economical feasibility
2. Technical feasibility
3. Operational feasibility Economical Feasibility:-

Economic analysis is the most frequently used method for evaluating the ef-
fectiveness of a candidate system. The proposed system is economically fea-
sible because the benefits and the savings that are expected from a candidate
system outweigh the cost incurred. In this case we are getting the intan- gible
benefits in terms of low cost of maintenance of data, less redundancy and
getting the quick results.

Technical Feasibility:-
The existing Hardware and Software facilities support the proposed system.
Computer
and storage media are available and software can be developed.

Hardware configuration:

a) Processor : AMD Ryzen 5 4600H with Radeon Graphics


b) Memory : 8 GB RAM
c) GPU: Nvidia GeForce GTX 1650 4GB
d) SSD capacity : 1.5 TB

Software configuration:-

a) Operating system : Windows 11


b) Back end : MySQL
c) Front end : Python

*to contind...
Operational Feasibility:-

As in the case of present system the entire work is being done manually.
So the data being scattered, information retrieval becomes difficult and
maintaining database is also very tedious. In case of proposed system,
entire work will be done automatically. So the above details regarding
the feasibility study show that the design of the pro- posed system is
very effective.
INTRODUCTION
ABOUT THE PROJECT:

In an era dominated by technological advancements, the Library Management System (LMS) proj-
ect emerges as a pivotal initiative to redefine and enhance the functionalities of our library. This
project seeks to address the evolving needs of library management by introducing a comprehen-
sive and efficient system that seamlessly integrates with contemporary practices.

Key Highlights:

1. Automation for Efficiency:


The LMS project is centered around automating critical library processes, particularly book check-
in/check-out procedures. By minimizing manual effort, we aim to streamline operations and ensure
a more accurate and expedited experience for both librarians and patrons.

2. Member-Centric Services:
One of the primary goals of the project is to enhance member interaction through simplified regis-
tration processes and personalized member profiles. This approach ensures that library services are
tailored to meet the unique needs of individual members.

3. Accurate Record-Keeping:
The implementation of a robust database forms the backbone of the LMS project, providing a cen-
tralized repository for maintaining real-time records of books, members, and transactions. This
commitment to accuracy ensures a reliable foundation for efficient library management.

4. Intuitive User Interface:


Recognizing the importance of a user-friendly experience, the project focuses on designing an
intuitive interface. This interface is crafted to be easily navigable, promoting accessibility and cre-
ating a positive interaction between users and the library system.

5. Data-Driven Decision-Making:
The LMS project incorporates reporting and analytics tools to offer valuable insights into library us-
age and resource popularity. These insights empower librarians with data-driven decision-making
capabilities, allowing for the optimization of library resources.

6. Enhanced Resource Discovery:


Going beyond traditional library systems, the project introduces features to facilitate the efficient
discovery of resources. Whether it’s books, journals, or multimedia, users will experience an im-
proved and intuitive resource search and retrieval process.

7. Security and Scalability:


Emphasizing the importance of data security, the LMS project ensures that access to sensitive
information is protected. Moreover, the design allows for scalability, accommodating future expan-
sions and technological advancements in the field of library management.

In essence, the Library Management System project is not merely a technological upgrade but a
strategic initiative to align our library services with the contemporary expectations of our users.
Through this project, we aspire to create an environment that seamlessly integrates technology,
efficiency, and a member-centric approach to elevate the overall library experience.
SOURCE CODE:

This code initializes a Tkinter window for a “Claret BookVault” application, connects
to a MySQL database, sets the window theme, and updates the window state, pos-
sibly maximizing it after a short delay.

(main.py)

def __init__(self, root):


self.root = root
self.root.title(“Claret BookVault”)
self.root.geometry(“1920x1080+0+0”)

self.style = ThemedStyle(self.root)
self.style.set_theme(“adapta”)
self.conn = mysql.connector.connect(host=”localhost”, username=”root”,
password=”root”, database=”library”)
self.cursor = self.conn.cursor()
self.update_final_price()
self.root.update_idletasks()
self.root.state(‘normal’)
self.root.update_idletasks()

delay = 0.1
time.sleep(delay)
self.root.state(‘zoomed’)
This code defines a method `add_data` within a class, which inserts member data
into a MySQL database table named “library.” It validates input fields, establishes
a database connection, constructs an SQL query for insertion, executes the query,
and handles potential errors, displaying appropriate messages using the `message-
box` module. The method also calls `fetch_data` to update displayed data after a
successful insertion. The error handling covers various MySQL error codes, provid-
ing specific messages for each case.

(main.py)

def add_data(self):
if not self.validate_fields():
return
try:
conn = mysql.connector.connect(host=”localhost”, username=”root”, password=”root”, database=”li-
brary”)
my_cursor = conn.cursor()

insert_query = “INSERT INTO library VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)”


data = (self.member_var.get(), self.prn_var.get(), self.id_var.get(), self.firstname_var.get(),
self.lastname_var.get(), self.address1_var.get(), self.address2_var.get(),
self.postcode_var.get(), self.mobile_var.get(), self.bookid_var.get(),
self.booktitle_var.get(), self.author_var.get(), self.dateborrowed_var.get(),
self.datedue_var.get(), self.daysonbook.get(), self.lateratefine_var.get(),
self.bookreturned.get(), self.finalprice.get())

my_cursor.execute(insert_query, data)
conn.commit()
conn.close()

messagebox.showinfo(“Success!!”, “Member has been inserted successfully!!”)


self.fetch_data()
except mysql.connector.Error as e:
error_msg = “An error occurred while adding data:\n”
if e.errno == mysql.connector.errorcode.ER_DUP_ENTRY:
error_msg += “Duplicate entry found. The provided data already exists.”
elif e.errno == mysql.connector.errorcode.ER_BAD_NULL_ERROR:
error_msg += “Please enter all required fields.”
elif e.errno == mysql.connector.errorcode.ER_ACCESS_DENIED_ERROR:
error_msg += “Access denied. Please check your database credentials.”
elif e.errno == mysql.connector.errorcode.ER_DBACCESS_DENIED_ERROR:
error_msg += “Access denied to the database.”
elif e.errno == mysql.connector.errorcode.ER_BAD_DB_ERROR:
error_msg += “The specified database does not exist.”
else:
error_msg += str(e)

print(error_msg)
messagebox.showerror(“Error!!”, error_msg)
This code defines a method `fetch_data` within a class, which retrieves all records
from a MySQL database table named “library.” It establishes a database connec-
tion, executes a SELECT query, fetches the resulting rows, and populates a Tkinter
Treeview widget (likely named `self.library_table`) with the retrieved data. The meth-
od then commits the changes and closes the database connection. The purpose is
to display the library data in a graphical interface, presumably for user interaction
or management.

(main.py)

def fetch_data(self):
conn = mysql.connector.connect(host=”localhost”, username=”root”,
password=”root”, database=”library”)
my_cursor = conn.cursor()
my_cursor.execute(“SELECT * FROM LIBRARY”)
rows=my_cursor.fetchall()

if len(rows)!=0:
self.library_table.delete(*self.library_table.get_children())
for i in rows:
self.library_table.insert(“”,END,values=i)
conn.commit()
conn.close()
This method updates the “Final Price” in the “library” table by incrementing it by Rs.
50 for records where the “Book Returned” field is ‘NO’ and the “Date Due” is earli-
er than the current date. In other words, it adds Rs. 50 for records where the book
hasn’t been returned after the due date.

(main.py)

def update_final_price(self):
today = datetime.date.today()

select_query = “SELECT `Final Price` FROM library WHERE `Book Returned`


= ‘NO’ AND `Date Due` < %s”
self.cursor.execute(select_query, (today,))
results = self.cursor.fetchall()

update_query = “UPDATE library SET `Final Price` = CONCAT(‘Rs.’, CAST(-


CAST(SUBSTRING_INDEX(`Final Price`, ‘Rs.’, -1) AS DECIMAL(10,0)) + 50 AS CHAR))
WHERE `Book Returned` = ‘NO’ AND `Date Due` < %s”
self.cursor.execute(update_query, (today,))
self.conn.commit()
This method populates a Tkinter Text widget (`self.txtBox`) with data retrieved from
various Tkinter variables. It displays information related to member details, book de-
tails, and transaction specifics, making it suitable for showing a summary or details
of entered data in a graphical user interface.

(main.py)

def showData (self):


self.txtBox.insert (END, “Member Type: \t\t”+ self.member_var.get() + “\n”)
self.txtBox.insert (END, “PRN No: \t\t”+ self.prn_var.get() + “\n”)
self.txtBox.insert (END, “ID No: \t\t”+ self.id_var.get() + “\n”)
self.txtBox.insert (END, “FirstName: \t\t”+ self.firstname_var.get() + “\n”)
self.txtBox.insert (END, “LastName: \t\t”+ self.lastname_var.get() + “\n”)
self.txtBox.insert (END, “Address1: \t\t”+ self.address1_var.get() + “\n”)
self.txtBox.insert (END, “Address2: \t\t”+ self.address2_var.get() + “\n”)
self.txtBox.insert (END, “Post Code: \t\t”+ self.postcode_var.get() + “\n”)
self.txtBox.insert (END, “Mobile No: \t\t”+ self.mobile_var.get() + “\n”)
self.txtBox.insert (END, “Book ID: \t\t” + self.bookid_var.get() + “\n”)
self.txtBox.insert (END, “Book Title: \t”+ self.booktitle_var.get() + “\n”)
self.txtBox.insert (END, “Author: \t\t”+ self.author_var.get() + “\n”)
self.txtBox.insert (END, “Date Borrowed: \t\t”+ self.dateborrowed_var.get() + “\n”)
self.txtBox.insert (END, “Date Due: \t\t”+ self.datedue_var.get() + “\n”)
self.txtBox.insert (END, “Days On Book: \t\t” + self.daysonbook.get() + “\n”)
self.txtBox.insert (END, “Late Rate Fine: \t\t”+ self.lateratefine_var.get() + “\n”)
self.txtBox.insert (END, “Date Over Due: \t\t”+ self.bookreturned.get() + “\n”)
self.txtBox.insert (END, “Final Price: \t\t”+ self.finalprice.get() + “\n”)
This method resets the values of various Tkinter variables and clears the content of
a Tkinter Text widget (`self.txtBox`). It is designed to clear input fields and displayed
data, effectively resetting the state of the graphical user interface.

(main.py)

def reset(self):
self.member_var.set(“”),
self.prn_var.set(“”),
self.id_var.set(“”),
self.firstname_var.set(“”),
self.lastname_var.set(“”),
self.address1_var.set(“”),
self.address2_var.set(“”),
self.postcode_var.set(“”),
self.mobile_var.set(“”),
self.bookid_var.set(“”),
self.booktitle_var.set(“”),
self.author_var.set(“”),
self.dateborrowed_var.set(“”),
self.datedue_var.set(“”),
self.daysonbook.set(“”),
self.lateratefine_var.set(“”),
self.bookreturned.set(“”),
self.finalprice.set(“”)
self.txtBox.delete(“1.0”, END)
This method displays a confirmation message box asking if the user is sure they
want to exit the “Claret BookVault” application. If the user clicks “Yes,” the method
closes the Tkinter window (`self.root`) and terminates the application.

(main.py)

def iExit(self):
iExit=tkinter.messagebox.askyesno(“Claret BookVault”,”Are you sure you
want to exit?”)
if iExit>0:
self.root.destroy()
return
This method updates member details in a MySQL database table named “library.” It
validates input fields, connects to the database, executes an SQL UPDATE query, and
handles errors. The success message is displayed, and displayed data is updated.

(main.py)
def update(self):
if not self.validate_fields():
return
try:
conn = mysql.connector.connect(host=”localhost”, username=”root”, password=”root”, database=”library”)
my_cursor = conn.cursor()

sql = “””
UPDATE library
SET `Member Type` = %s, ID = %s, `First Name` = %s, `Last Name` = %s, Address1 = %s, `Address 2` = %s, Post_ID = %s,
Mobile = %s, Book_ID = %s, `Book Title` = %s, Author = %s, `Date Borrowed` = %s, `Date Due` = %s,
`Days on Book` = %s, `Late Return Fine` = %s, `Book Returned` = %s, `Final Price` = %s
WHERE PRN_NO = %s
“””
values = (
self.member_var.get(),
self.id_var.get(),
self.firstname_var.get(),
self.lastname_var.get(),
self.address1_var.get(),
self.address2_var.get(),
self.postcode_var.get(),
self.mobile_var.get(),
self.bookid_var.get(),
self.booktitle_var.get(),
self.author_var.get(),
self.dateborrowed_var.get(),
self.datedue_var.get(),
self.daysonbook.get(),
self.lateratefine_var.get(),
self.bookreturned.get(),
self.finalprice.get(),
self.prn_var.get()
)

my_cursor.execute(sql, values)
conn.commit()
conn.close()

messagebox.showinfo(“Success!!”, “Member details updated successfully!!”)


self.fetch_data()
except mysql.connector.Error as e:
error_msg = “An error occurred while updating data:\n”
if e.errno == mysql.connector.errorcode.ER_DUP_ENTRY:
error_msg += “Duplicate entry found. The provided data already exists.”
elif e.errno == mysql.connector.errorcode.ER_BAD_NULL_ERROR:
error_msg += “Please enter all required fields.”
elif e.errno == mysql.connector.errorcode.ER_ACCESS_DENIED_ERROR:
error_msg += “Access denied. Please check your database credentials.”
elif e.errno == mysql.connector.errorcode.ER_DBACCESS_DENIED_ERROR:
error_msg += “Access denied to the database.”
elif e.errno == mysql.connector.errorcode.ER_BAD_DB_ERROR:
error_msg += “The specified database does not exist.”
else:
error_msg += str(e)

print(error_msg)
messagebox.showerror(“Error!!”, error_msg)
This method deletes a member from a MySQL database table named “library.” It
checks if required fields (PRN and ID) are filled, shows an error message if not, and
prompts for confirmation before deletion. If confirmed, it connects to the database,
executes a DELETE query, commits changes, displays a success message, updates
displayed data, and resets input fields.

(main.py)

def delete(self):
if self.prn_var.get() == “” or self.id_var.get() == “”:
messagebox.showerror(“Error”, “Please select a member!!”)
else:
confirmation = messagebox.askyesno(“Confirmation”, “Are you sure you want
to delete this member?”)
if confirmation:
conn = mysql.connector.connect(host=”localhost”, username=”root”, pass-
word=”root”, database=”library”)
my_cursor = conn.cursor()
query = “DELETE FROM library WHERE PRN_NO=%s”
value = (self.prn_var.get(), )
my_cursor.execute(query, value)
conn.commit()
conn.close()
messagebox.showinfo(“Success!!”, “Member has been deleted!”)
self.fetch_data()
self.reset()
This method handles the return of a book for a selected member in a Tkinter Treeview
(`self.library_table`). It checks if a member is selected, retrieves relevant values, and
updates the “Book Returned” status in a MySQL database table named “library.” It
then fetches updated data, displays a success message, or informs the user if the
book has already been returned or if no member is selected.

(main.py)

def book_returned(self):
selected_item = self.library_table.focus()
if selected_item:
values = self.library_table.item(selected_item)[‘values’]
prn_no = values[1]
book_returned = values[16]

if book_returned == “NO”:
conn = mysql.connector.connect(host=”localhost”, username=”root”, pass-
word=”root”, database=”library”)
cursor = conn.cursor()

update_query = “UPDATE library SET `Book Returned` = ‘YES’ WHERE PRN_NO


= %s”
cursor.execute(update_query, (prn_no,))
conn.commit()

conn.close()
self.fetch_data()
messagebox.showinfo(“Success!!”, “Book returned successfully!”)
else:
messagebox.showinfo(“Information”, “Book already returned!”)
else:
messagebox.showinfo(“Information”, “Please select a member!”)
This function validates entered credentials against predefined correct values for a
username and password. If the entered username and password match the correct
ones, it returns `True`; otherwise, it returns `False`. In this example, the correct user-
name and password are “claret24”.

(LoginPage.py)

def validate_credentials(entered_username, entered_password):


correct_username = “claret24”
correct_password = “claret24”

if entered_username == correct_username and entered_password == correct_


password:
return True
else:
return False
MySQL queries for the creation of required databases:

(library.sql)

-- Create the “library” database if it doesn’t exist


CREATE DATABASE IF NOT EXISTS library;

-- Switch to the “library” database


USE library;

-- Create the “library” table


CREATE TABLE IF NOT EXISTS library (
`Member Type` VARCHAR(255),
PRN_NO VARCHAR(255),
ID VARCHAR(255),
`First Name` VARCHAR(255),
`Last Name` VARCHAR(255),
`Address1` VARCHAR(255),
`Address 2` VARCHAR(255),
Post_ID VARCHAR(255),
Mobile VARCHAR(255),
Book_ID VARCHAR(255),
`Book Title` VARCHAR(255),
Author VARCHAR(255),
`Date Borrowed` DATE,
`Date Due` DATE,
`Days on Book` VARCHAR(255),
`Late Return Fine` VARCHAR(255),
`Book Returned` VARCHAR(255),
`Final Price` VARCHAR(255)
);
OUTPUT

Login Page:

Enter authentic credentials for successful login.


OUTPUT

Main Window (Claret BookVault):

Add Data:

Successfully added; Pop-Up Message Box.


BIBLIOGRAPHY

For successfully completing my project, I have taken help from the following
wesites links/ books:

• Informatics Practices Textbook by Sumita Arora

• www.geeksforgeeks.org

• www.pypi.org

• www.stackoverflow.com

You might also like