IP Class 12 Library Management Project 2024-25
IP Class 12 Library Management Project 2024-25
IP Class 12 Library Management Project 2024-25
Preface
SDLC
Phases Of SDLC
About Python
About CSV
Source Code
Output
Preface
Book Management:
Explore, add, modify, or delete books from the library collection.
Data Visualization:
Gain insights into library data through visualizations.
Fine Calculation:
Automatically calculate fines for overdue books.
Objectives of Project
The Library Management System project aims to revolutionize
the management of library operations by automating and
optimizing various tasks. The primary objective is to streamline
processes and fine calculation which reduces manual efforts
and minimizing errors. The system will focus on creating a user-
friendly interface for both Library staff and members, ensuring a
seamless experience.
Graphical Representation:
Generate graphical representations such as bar charts, pie
charts for better understanding of the trends.
Educational Introduction:
Provide an introduction to Library management, explaining the
various aspects involved, such as member management, book
exploring, issuing and returning process and fine collection.
Offer information about the main objective, emphasizing the
importance of an optimal interaction system.
Page 4
Software Development
Life Cycle (SDLC)
Definition:
The Software Development Life Cycle (SDLC) is a
structured process that enabled the production of high-
quality, low-cost software, in the shortest possible
production time. The goal of the SDLC is to produce
superior software that meets and exceeds all customer
expectations and demands.
Page 5
Coding Phase:
The coding phase includes system design in integrated
development environment. It also includes static code analysis
and code review for multiple types of devices.
Testing Phase:
The development team combines automation and manual
testing to check the software for bugs. Quality analysis includes
testing the software for errors and checking if it meets
customer requirements.
Release Phase:
The release phase involves the team packaging, managing and
deploying releases across different environments.
Deploy Phase:
In the deployment phase, the software is officially released into
the production environment.
Monitor Phase:
In the monitor phase, various elements of the software are
monitored. These could include the overall system performance,
user experience, new security vulnerabilities, an analysis of bugs
or errors in the system.
Page 7
Tools/Platform and
languages to be used
Python
Introduction:
Python is a high-level, interpreted programming language
known for its simplicity, readability and versatility. It was
created by Guido van Rossum and first released in 1991.
Python is designed with an emphasis on code readability
and is widely used for web development, data analysis,
artificial intelligence, scientific computing, automation, and
more. Its clean and straightforward syntax makes it an
excellent choice for both beginners and experienced
programmers.
Features Of Python:
1. Readability:
Python uses a clear and easily understandable syntax, which
makes it easy to write and maintain code.This readability
promotes better collaboration among developers.
2. High-Level Language:
Python is a high-level language, meaning it abstracts complex low-
level details, allowing developers to focus on solving problems
rather than dealing with hardware-specific issues.
3. Versatile:
Python can be used for a wide range of applications, meaning it
abstracts complex low-level details, allowing developers to focus
on solving problems rather than dealing with hardware-specific
issues.
Page 9
5. Open Source:
Python is open source, meaning it’s freely available for anyone to
use, modify and distribute. This has led to a large and active
community of Python users and contributors.
Advantages of Python:
1. Easy to learn and use.
2. Free and Open-Source.
3. Rapid Development
4. Interpreted Language
5. Wide Range of Libraries and Frameworks.
6. Dynamically Typed and Portable
CSV
(Comma Separated Values)
Introduction:
A CSV (Comma-Separated Values) file is a widely used
plain text file format for storing structured tabular data.
Each line in a CSV file represents a single row of data, and
individual values within each row are separated by
commas. CSV files are simple to create, read, and edit,
making them a popular choice for data interchange
between different software applications.
Source Code
import pandas as pd
import matplotlib.pyplot as plt
# CSV files
member_df = pd.read_csv("member.csv")
book_df = pd.read_csv("book.csv")
merged_data = pd.read_csv("merged_data.csv")
while True:
print("\n" + "*" * 78)
print(" " * 27 + "Library Management
Project")
print("*" * 78)
print("0. Introduction")
print("1. Member Management")
print("2. Explore Books")
print("3. Issue Books")
print("4. Return Books")
print("5. Data Visualization")
print("6. Fine Calculation")
print("7. Exit Program")
if main_option == 0:
print("\n" + "*" * 78)
print(" " * 33 + "Introduction")
print("*" * 78)
print("""
Welcome to the Library Management
System
Page 12
- Key Features:
* Member Management: Add, modify,
delete member information
* Book Management: Explore, add,
modify, delete from the library collection
* Book Issue and Return: Keep track of
issues and returns of the books
* Data Visualization: Gain insights
into book availability
* Fine Calculation: Calculate fines
for overdue books
Thank you for choosing our library
Management System. Enjoy!
""")
elif main_option == 1:
print("\n" + "*" * 78)
print(" " * 31 + "Member Management")
print("*" * 78)
print("1. Read Member Data")
print("2. Add New Member")
print("3. Modify Member Data")
print("4. Delete Member Data")
print("5. Back to Main Menu")
elif member_option == 2:
print("\n" + "*" * 78)
print(" " * 31 + "Add New Member")
print("*" * 78)
new_member_id = member_df["Member
ID"].max() + 1
name = input("Enter Member Name: ")
while True:
aadhar_no = input("Enter Aadhar
Number: ")
if len(aadhar_no) == 12 and
aadhar_no.isdigit():
if aadhar_no not in
member_df["Aadhar No"].values:
break
else:
print("Aadhar number is
already registered. Please enter a unique Aadhar
number.")
else:
print("Invalid Aadhar number.
Please enter a 12-digit numeric Aadhar Number.")
Page 16
new_member = pd.DataFrame({"Member
ID": [new_member_id], "Name": [name], "Aadhar
No": [aadhar_no]})
if 'DataFrame' in
str(type(member_df)):
member_df = pd.concat([member_df,
new_member], ignore_index=True)
else:
member_df = pd.DataFrame({"Member
ID": [new_member_id], "Name": [name], "Aadhar
No": [aadhar_no]})
member_df.to_csv("member.csv",
index=False)
print(f"New member added successfully.
Member ID: {new_member_id}.")
elif member_option == 3:
print("\n" + "*" * 78)
print(" " * 32 + "Modify Member Data")
print("*" * 78)
member_id_to_modify =
int(input("Enter Member ID to modify: "))
if member_id_to_modify in
member_df["Member ID"].values:
print("1. Modify Name")
print("2. Modify Aadhar Number")
modification_option =
int(input("Enter your modification choice: "))
if modification_option == 1:
new_name = input("Enter the
new name: ")
Page 17
member_df.loc[member_df["Membe
r ID"] == member_id_to_modify, "Name"] =
new_name
print("Name modified
successfully")
elif modification_option == 2:
while True:
new_aadhar_no =
input("Enter new Aadhar Number: ")
if len(new_aadhar_no) ==
12 and new_aadhar_no.isdigit():
if new_aadhar_no not
in member_df["Aadhar No"].values:
member_df.loc[membe
r_df["Member ID"] == member_id_to_modify,
"Aadhar No"] = new_aadhar_no
print("Aadhar
number updated successfully")
break
else:
print("Aadhar
number is already registered")
else:
print("Invalid Aadhar
Number")
else:
print('Invalid modification
option')
member_df.to_csv("member.csv",
index=False)
else:
print("Member ID not found.
Please enter a valid Member ID.")
elif member_option == 4:
print("\n" + "*" * 78)
Page 18
print(" " * 32 + "Delete Member Data")
print("*" * 78)
member_id_to_delete =
int(input("Enter member ID to delete: "))
if member_id_to_delete in
member_df["Member ID"].values:
print("Member information to
Delete:")
print(member_df[member_df["Member
ID"] == member_id_to_delete])
if confirmation == "yes":
member_df =
member_df[member_df["Member ID"] !=
member_id_to_delete]
print("Member deleted
successfully")
member_df.to_csv("member.csv",
index=False)
else:
print("Deletion canceled.")
else:
print("Member ID not found.")
elif member_option == 5:
continue
else:
print('Invalid option')
elif main_option == 2:
print("\n" + "*" * 78)
print(" " * 31 + "Book Management")
Page 19
print("*" * 78)
print("1. Read Book Data")
print("2. Add New Book")
print("3. Modify Book Data")
print("4. Delete Book Data")
print("5. Back to Main Menu")
if book_option == 1:
print("\n" + "*" * 78)
print(" " * 32 + "Search Books")
print("*" * 78)
print("1. Search Available Books")
print("2. Search Non-Available Books")
print("3. Search Books by Author")
print("4. Back to Book Management")
if search_option == 1:
print("Available Books:")
available_books =
book_df[book_df["Availability"] == "Yes"]
print(available_books)
elif search_option == 2:
print("Non-Available Books:")
unavailable_books =
book_df[book_df["Availability"] == "No"]
print(unavailable_books)
elif search_option == 3:
author_name = input("Enter author
name to search: ")
Page 20
result =
book_df[book_df["Author"].str.contains(author_na
me, case=False)]
if not result.empty:
print("Matching books by
author:")
print(result)
else:
print("No books found by that
author.")
elif search_option == 4:
continue
else:
print('Invalid choice')
elif book_option == 2:
print("\n" + "*" * 78)
print(" " * 32 + "Add New Book")
print("*" * 78)
if 'DataFrame' in str(type(book_df)):
book_df = pd.concat([book_df,
new_book], ignore_index=True)
else:
Page 21
book_df = pd.DataFrame({"Book ID":
[new_book_id], "Book Name": [book_name],
"Author": [author], "Availability":
[availability]})
book_df.to_csv("book.csv",
index=False)
print(f"New book added successfully.
Book ID: {new_book_id}.")
elif book_option == 3:
print("\n" + "*" * 78)
print(" " * 32 + "Modify Book Data")
print("*" * 78)
book_id_to_modify = int(input("Enter
Book ID to modify: "))
if book_id_to_modify in book_df["Book
ID"].values:
print("1. Modify Book Name")
print("2. Modify Author Name")
print("3. Modify Availability")
modification_option =
int(input("Enter your modification choice: "))
if modification_option == 1:
new_book_name = input("Enter
the new book name: ")
book_df.loc[book_df["Book ID"]
== book_id_to_modify, "Book Name"] =
new_book_name
print("Book name modified
successfully")
elif modification_option == 2:
Page 22
new_author_name = input("Enter
the new author name: ")
book_df.loc[book_df["Book ID"]
== book_id_to_modify, "Author"] =
new_author_name
print("Author name modified
successfully")
elif modification_option == 3:
new_availability =
input("Enter new availability (Yes/No): ")
book_df.loc[book_df["Book ID"]
== book_id_to_modify, "Availability"] =
new_availability
print("Availability updated
successfully")
else:
print('Invalid modification
option')
book_df.to_csv("book.csv",
index=False)
else:
print("Book ID not found. Please
enter a valid Book ID.")
elif book_option == 4:
print("\n" + "*" * 78)
print(" " * 32 + "Delete Book Data")
print("*" * 78)
book_id_to_delete = int(input("Enter
Book ID to delete: "))
if book_id_to_delete in book_df["Book
ID"].values:
print("Book information to
Delete:")
Page 23
print(book_df[book_df["Book ID"]
== book_id_to_delete])
if confirmation == "yes":
book_df =
book_df[book_df["Book ID"] != book_id_to_delete]
print("Book deleted
successfully")
book_df.to_csv("book.csv",
index=False)
else:
print("Deletion canceled.")
else:
print("Book ID not found.")
elif book_option == 5:
continue
else:
print('Invalid option')
elif main_option == 3:
print("\n" + "*" * 78)
print(" " * 33 + "Issue Book")
print("*" * 78)
merged_data.loc[merged_data["M
ember ID"] == member_id, "Book ID"] += f",
{book_id}"
merged_data.to_csv("merged_dat
a.csv", index=False)
else:
print("Book is not available
for issuing.")
else:
print("Book ID not found.")
else:
print("Member ID not found.")
elif main_option == 4:
print("\n" + "*" * 78)
print(" " * 33 + "Return Book")
print("*" * 78)
merged_data.loc[merged_data["M
ember ID"] == member_id, "Book ID"] =
merged_data.loc[merged_data["Member ID"] ==
member_id, "Book ID"].str.replace(f", {book_id}",
"").replace(f"{book_id}, ",
"").replace(f"{book_id}", "")
merged_data.to_csv("merged_dat
a.csv", index=False)
else:
print("Book is not issued.")
else:
print("Book ID not found.")
else:
print("Member ID not found.")
elif main_option == 5:
print("\n" + "*" * 78)
print(" " * 29 + "Books Availability
Visualization")
print("*" * 78)
availability_counts =
book_df['Availability'].value_counts()
total_books = availability_counts.sum()
plt.figure(figsize=(8, 6))
Page 26
availability_counts.plot(kind='bar',
color=['lightgreen', 'salmon'])
plt.title(f'Books Availability
Status\nTotal Books: {total_books}')
plt.xlabel('Status Of Availability')
plt.ylabel('Number of Books')
plt.xticks(rotation=0)
plt.tight_layout()
plt.savefig("books_availability.png")
plt.show()
elif main_option == 6:
print("\n" + "*" * 78)
print(" " * 30 + "Fine Calculation")
print("*" * 78)
member_id = int(input("Enter Member ID
for fine calculation: "))
if member_id in member_df["Member
ID"].values:
days_overdue = int(input("Enter
number of overdue days: "))
if days_overdue > 0:
fine = days_overdue * 10
print(f"The fine for Member ID
{member_id} is: {fine} RS.")
else:
print("No fine applicable. The
book is not overdue.")
else:
print("Member ID not found.")
elif main_option == 7:
print("Exiting program. Thank you for
using the Library Management System!")
break
else:
print("Invalid choice. Please try again.")
Page 27
Output (Logs)
***********************************************
Library Management Project
***********************************************
0. Introduction
1. Member Management
2. Explore Books
3. Issue Books
4. Return Books
5. Data Visualization
6. Fine Calculation
7. Exit Program
Enter your choice:
# INTRODUCTION
***********************************************
Library Management Project
***********************************************
0. Introduction
1. Member Management
2. Explore Books
3. Issue Books
4. Return Books
5. Data Visualization
6. Fine Calculation
7. Exit Program
Enter your choice: 0
***********************************************
Welcome to the Library Management System
# MEMBER MANAGEMENT
***********************************************
Library Management Project
***********************************************
0. Introduction
1. Member Management
2. Explore Books
3. Issue Books
4. Return Books
5. Data Visualization
6. Fine Calculation
7. Exit Program
Enter your choice: 1
***********************************************
, Member Management
***********************************************
1. Read Member Data
2. Add New Member
3. Modify Member Data
4. Delete Member Data
5. Back to Main Menu
Enter Your Choice: 1
***********************************************
Read Member Data
Page 29
***********************************************
1. Display top 5 records of members
2. Display bottom 5 records of members
3. Search member by Name
4. Search member by Member ID
5. Search member by Book Issued (Book Name)
6. Search member by Book Issued (Author Name)
7. Back to Member Management
Enter your sub-choice: 1
Displaying top 5 records of members:
Member ID Name Aadhar No
0 1 John Doe 1234567890
1 2 Jane Smith 2345678901
2 3 Alex Brown 3456789012
3 4 Emily Clark 4567890123
4 5 Michael Lee 5678901234
***********************************************
Member Management
***********************************************
1. Read Member Data
2. Add New Member
3. Modify Member Data
4. Delete Member Data
5. Back to Main Menu
Enter Your Choice: 2
***********************************************
Add New Member
***********************************************
Enter Member Name: Alice
Enter Aadhar Number: 5555444433
New member added successfully. Member ID: 6.
***********************************************
Modify Member Data
***********************************************
Enter Member ID to modify: 6
1. Modify Name
2. Modify Aadhar Number
Enter your modification choice: 1
Enter the new name: Alica
Page 30
Name modified successfully
***********************************************
Modify Member Data
***********************************************
Enter Member ID to modify: 6
1. Modify Name
2. Modify Aadhar Number
Enter your modification choice: 2
Enter new Aadhar Number: 1234567890
Aadhar number updated successfully
***********************************************
Member Management
***********************************************
1. Read Member Data
2. Add New Member
3. Modify Member Data
4. Delete Member Data
5. Back to Main Menu
Enter Your Choice: 4
***********************************************
Delete Member Data
***********************************************
Enter member ID to delete: 6
Member information to delete:
Member ID Name Aadhar No
5 6 Alica 1234567890
Are you sure you want to delete this member? (yes/no): yes
Member deleted successfully
# BOOK MANAGEMENT
***********************************************
Book Management
***********************************************
1. Read Book Data
2. Add New Book
Page 31
3. Modify Book Data
4. Delete Book Data
5. Back to Main Menu
Enter your choice: 1
***********************************************
Search Books
***********************************************
1. Search Available Books
2. Search Non-Available Books
3. Search Books by Author
4. Back to Book Management
Enter your choice: 1
***********************************************
Search Books
***********************************************
1. Search Available Books
2. Search Non-Available Books
3. Search Books by Author
4. Back to Book Management
Enter your choice: 2
***********************************************
Search Books
***********************************************
1. Search Available Books
2. Search Non-Available Books
3. Search Books by Author
4. Back to Book Management
Enter your choice: 3
Page 32
Enter author name to search: Harper Lee
***********************************************
Book Management
***********************************************
1. Read Book Data
2. Add New Book
3. Modify Book Data
4. Delete Book Data
5. Back to Main Menu
Enter your choice: 2
***********************************************
Add New Book
***********************************************
Enter Book Name: Harry Potter and the Prisoner of Azkaban
Enter Author Name: J. K. Rowling
Is the book available? (Yes/No): yes
New book added successfully. Book ID: 6.
***********************************************
Modify Book Data
***********************************************
Enter Book ID to modify: 6
1. Modify Book Name
2. Modify Author Name
3. Modify Availability
Enter your modification choice: 1
Enter the new book name: Harry Potter and the Chamber of
Secrets
Book name modified successfully
***********************************************
Delete Book Data
***********************************************
Enter Book ID to delete: 6
Page 33
# ISSUING BOOK
***********************************************
Library Management Project
***********************************************
0. Introduction
1. Member Management
2. Explore Books
3. Issue Books
4. Return Books
5. Data Visualization
6. Fine Calculation
7. Exit Program
Enter your choice: 3
***********************************************
Issue Book
***********************************************
Enter Member ID: 5
Enter Book ID to issue: 3
Book is not available for issuing.
***********************************************
Issue Book
***********************************************
Enter Member ID: 5
Enter Book ID to issue: 1
Book issued successfully.
Page 34
# RETURNING BOOK
***********************************************
Library Management Project
***********************************************
0. Introduction
1. Member Management
2. Explore Books
3. Issue Books
4. Return Books
5. Data Visualization
6. Fine Calculation
7. Exit Program
Enter your choice: 4
***********************************************
Return Book
***********************************************
Enter Member ID: 5
Enter Book ID to return: 5
Book is not issued.
***********************************************
Return Book
***********************************************
Enter Member ID: 5
Enter Book ID to return: 1
Book returned successfully.
Page 35
***********************************************
Data Visualization
***********************************************
# FINE CALCULATION
***********************************************
Library Management Project
***********************************************
0. Introduction
1. Member Management
2. Explore Books
3. Issue Books
4. Return Books
5. Data Visualization
6. Fine Calculation
7. Exit Program
Enter your choice: 6
Page 36
***********************************************
Fine Calculation
***********************************************
Enter Member ID for fine calculation: 1
Enter number of overdue days: 3
The fine for Member ID 1 is: 30 RS.
***********************************************
Library Management Project
***********************************************
0. Introduction
1. Member Management
2. Explore Books
3. Issue Books
4. Return Books
5. Data Visualization
6. Fine Calculation
7. Exit Program
Enter your choice: 7
Exiting program. Thank you for using the Library
Management System!
Page 37
CSV FILES
book.csv
member.csv
merged_data.csv
Page 38
Software Requirements:
Operating System - Windows 7 or better
Language - Python 3.6.2 or latest
Front End - IDLE (Python 3.6.2)
Back End - CSV Files (book, member, merged_data)
Page 39
Bibliography
Books:
Informatics Practices, Class XII NCERT
Informatics Practices, Class XII by Preeti Arora
Internet:
Python official documentation, https://python.org
GeeksforGeeks
Flask Documentation
Pandas & Matplotlib Documentation
https://learnpython.org