Library Management System
Library Management System
DONE BY,
P.A. SREEJITH
D. SANTHOSH
XII-FANTASTIC
CERTIFICATE
DATE: PRINCIPAL
DATE: PLACE:
ACKNOWLEDGEMENT
We wish to express our deep and profound gratitude to our teacher Ms.
KANIMOZHI, PGT (Computer Science), for her expert help and valuable guidance,
suggestions and comments.
We also place on record, our sincere gratitude to one and all who, directly or
indirectly have lent their helping hands in this venture.
INDEX
➢ Introduction to Python
➢ Advantages of Python
➢ Advantages
➢ Scope
➢ Source Code
➢ Conclusion
➢ Bibliography
INTRODUCTION TO PYTHON
Object-Oriented Programming
Python supports orientating programming; it permits polymorphism and
inheritance. Python users get to use the shareable categories.
Artificial Intelligence
Artificial Intelligence means that a machine program that acts or responds to
human brain intelligence is done through lots of algorithms or programs. It is
combined with scikit-learn python, which can do complex calculations with just a
single statement.
Computer Graphics
Python is largely used in small and large online or offline projects, and it is used to
build GUI, which stands for Graphical User Interface; it is also used for desktop
applications then we have Game development, so Tkinter is the standard GUI
library for python so python when combined with Tkinter it provides a fast and easy
way to create GUI application and programs.
INTRODUCTION TO LIBRARY MANAGEMENT SYSTEM
• At its core, the LMS acts as a digital catalog, organizing each item within
the library's inventory. Patrons can search, browse, and locate resources
with ease, akin to flipping through the pages of a well-organized index.
However, an LMS transcends the capabilities of traditional card catalogs. It
enables advanced search functionalities, allowing users to filter results by
title, author, subject, and more. Moreover, an LMS accommodates the
digital age, seamlessly integrating e-books, online journals, and multimedia
resources.
3. User Management: The LMS provides tools for managing user profiles
and memberships. It allows librarians to register new users, assign
membership categories, and keep track of user activities. User
management scope includes user authentication, profile customization,
and the ability to view and update personal information.
7. Reservation and Holds: The LMS offers users the scope to place
reservations or holds on items that are currently unavailable. This
feature ensures equitable access to high-demand resources and notifies
users when the reserved items become available for borrowing.
HARDWARE REQUIREMENTS:
I. OPERATING SYSTEM: WINDOWS 7 AND ABOVE
SOFTWARE REQUIREMENTS:
1. Windows operating system
2. Python (Script mode)
Reliability of Library Management System (LMS):
The reliability of a Library Management System (LMS) is a key factor in ensuring the
efficient organization and accessibility of library resources. LMS platforms offer a
dependable solution for libraries to streamline their operations and enhance the
user experience.
The reliability of an LMS also extends to user interactions. LMS platforms facilitate
seamless borrowing, returning, and renewing of materials. This ensures that
patrons can rely on the system to efficiently manage their library activities, making
their experience smooth and convenient.
Additionally, LMS platforms often integrate with external databases and online
resources. This integration enhances the reliability of the platform by providing
users with a comprehensive array of materials. Just as collaborations enhance
credibility, LMS partnerships with data providers contribute to the platform's
reliability.
# Connecting to Database
connector = sqlite3.connect('library.db')
cursor = connector.cursor()
connector.execute(
'CREATE TABLE IF NOT EXISTS Library (BK_NAME TEXT,
BK_ID TEXT PRIMARY KEY NOT NULL, AUTHOR_NAME TEXT,
BK_STATUS TEXT, CARD_ID TEXT)'
)
# Functions
def issuer_card():
Cid = sd.askstring('Issuer Card ID', 'What is the
Issuer\'s Card ID?\t\t\t')
if not Cid:
mb.showerror('Issuer ID cannot be zero!', 'Can\'t
keep Issuer ID empty, it must have a value')
else:
return Cid
def display_records():
global connector, cursor
global tree
tree.delete(*tree.get_children())
def clear_fields():
global bk_status, bk_id, bk_name, author_name,
card_id
bk_status.set('Available')
for i in ['bk_id', 'bk_name', 'author_name',
'card_id']:
exec(f"{i}.set('')")
bk_id_entry.config(state='normal')
try:
tree.selection_remove(tree.selection()[0])
except:
pass
def clear_and_display():
clear_fields()
display_records()
def add_record():
global connector
global bk_name, bk_id, author_name, bk_status
if bk_status.get() == 'Issued':
card_id.set(issuer_card())
else:
card_id.set('N/A')
if surety:
try:
connector.execute(
'INSERT INTO Library (BK_NAME, BK_ID,
AUTHOR_NAME, BK_STATUS, CARD_ID) VALUES (?, ?, ?, ?, ?)',
(bk_name.get(), bk_id.get(),
author_name.get(), bk_status.get(), card_id.get()))
connector.commit()
clear_and_display()
def view_record():
global bk_name, bk_id, bk_status, author_name,
card_id
global tree
if not tree.focus():
mb.showerror('Select a row!', 'To view a record,
you must select it in the table. Please do so before
continuing.')
return
current_item_selected = tree.focus()
values_in_selected_item =
tree.item(current_item_selected)
selection = values_in_selected_item['values']
bk_name.set(selection[1])
bk_id.set(selection[2])
bk_status.set(selection[4])
author_name.set(selection[3])
try:
card_id.set(selection[5])
except IndexError:
card_id.set('')
def update_record():
def update():
global bk_status, bk_name, bk_id, author_name,
card_id
global connector
if bk_status.get() == 'Issued':
card_id.set(issuer_card())
else:
card_id.set('N/A')
edit.destroy()
bk_id_entry.config(state='normal')
clear.config(state='normal')
clear_and_display()
view_record()
bk_id_entry.config(state='disable')
clear.config(state='disable')
def remove_record():
if not tree.selection():
mb.showerror('Error!', 'Please select an item
from the database')
return
current_item = tree.focus()
values = tree.item(current_item)
selection = values["values"]
tree.delete(current_item)
def delete_inventory():
if mb.askyesno('Are you sure?', 'Are you sure you
want to delete the entire inventory?\n\nThis command
cannot be reversed'):
tree.delete(*tree.get_children())
def change_availability():
global card_id, tree, connector
if not tree.selection():
mb.showerror('Error!', 'Please select a book from
the database')
return
current_item = tree.focus()
values = tree.item(current_item)
BK_id = values['values'][2]
BK_status = values["values"][4]
if BK_status == 'Issued':
surety = mb.askyesno('Is return confirmed?', 'Has
the book been returned to you?')
if surety:
cursor.execute('UPDATE Library SET
BK_STATUS=?, CARD_ID=? WHERE BK_ID=?', ('Available',
'N/A', BK_id))
connector.commit()
else:
mb.showinfo('Cannot be returned', 'The book
status cannot be set to Available unless it has been
returned')
else:
cursor.execute('UPDATE Library SET BK_STATUS=?,
CARD_ID=? WHERE BK_ID=?', ('Issued', issuer_card(),
BK_id))
connector.commit()
clear_and_display()
# Variables
lf_bg = 'LightSkyBlue' # Left Frame Background Color
rtf_bg = 'DeepSkyBlue' # Right Top Frame Background
Color
rbf_bg = 'DodgerBlue' # Right Bottom Frame Background
Color
btn_hlb_bg = 'SteelBlue' # Background color for Head
Labels and Buttons
# StringVars
bk_status = StringVar()
bk_name = StringVar()
bk_id = StringVar()
author_name = StringVar()
card_id = StringVar()
# Frames
left_frame = Frame(root, bg=lf_bg)
left_frame.place(x=0, y=30, relwidth=0.3, relheight=0.96)
RB_frame = Frame(root)
RB_frame.place(relx=0.3, rely=0.24, relheight=0.785,
relwidth=0.7)
# Left Frame
Label(left_frame, text='Book Name', bg=lf_bg,
font=lbl_font).place(x=98, y=25)
Entry(left_frame, width=25, font=entry_font,
text=bk_name).place(x=45, y=55)
tree.config(xscrollcommand=XScrollbar.set,
yscrollcommand=YScrollbar.set)
clear_and_display()
OUTPUT:
CONCLUSION
The LMS's ability to authenticate data and provide convenient access regardless of
location is a testament to its reliability. Moreover, the platform's adaptability and
integration with external sources enhance its offerings, providing a holistic
experience for users.
Just as any reliable service is built on the foundation of user trust, the LMS
prioritizes the user experience and their confidence in the system. This user-
centered approach reaffirms the LMS's significance in modern information
management, allowing individuals to explore, learn, and engage with resources
effectively.