PWP Project
PWP Project
“Library Management”
1. Brief Introduction:
In today's digital era, managing a library efficiently requires an organized system that can
handle book records, user data, and transactions seamlessly. This project aims to develop a
Python-based Library Management System that leverages file handling for data storage and
retrieval, ensuring a structured and user-friendly approach to library management. The system
will allow users to add new books, view the list of available books, delete records, and sort books
based on different criteria such as name or price. Additionally, it will include search functionality
to quickly find books based on their title or author name. By implementing error handling and
data validation, the system will maintain reliability and accuracy.
The project will be developed using Python’s built-in capabilities, utilizing file handling
techniques to store and manage book records persistently. Sorting and searching algorithms will
enhance data accessibility, providing an optimized user experience. This Library Management
System serves as a practical implementation of software development concepts, offering a
scalable and efficient solution for library administration while demonstrating the power of Python
in real-world applications.
2. Aims of Micro-project:
5. Submitted By:
“ Library Management ”
Submitted by
In Partial Fulfillment of
This is to certify that the Micro project entitled “Library Management” under the course of
“Programming With Python” submitted to the Institute of Civil and Rural Engineering,
Gargoti in partial fulfilment of Diploma in Computer Engineering is a record of original work
done by Prarthana during the period from 2024 to 2025 under supervision and guidance
Mr V. S. Kalke , Lecturer in department of Computer Engineering.
I am Prarthana hereby, declares that the Micro Project submitted to the Institute of Civil
and Rural Engineering, Gargoti in partial fulfillment of Diploma in Computer Engineering
done in the period of 2024-2025 under the supervision and guidance of Mr. V. S. Kalke,
Lecturer in department of Computer Engineering. The project has not been copied with any
other candidate of any diploma college.
SR .NO TITLE
1. Rationale
2. Aims/benefits of Microproject
4. Literature Review
7. Skill Developed
Submitted By
Exam Seat
Sr. No. Name Roll No. Enrollment No. Signature
Number
a) It aims to develop an interactive and user-friendly system for managing library book
records efficiently.
b) It aims to utilize Python’s file handling capabilities to store and retrieve book details
without requiring a database.
c) To enable sorting and searching functionalities, allowing users to find books easily based
on title, author, or price.
• References
https://www.geeksforgeeks.org/python-programming-language-tutorial/
https://www.programiz.com/python-programming/online-compiler/
https://docs.python.org/3/tutorial/index.html
5.0 Actual Methodology Followed
➢ Introduction
➢ View All Books – Read and Display Books from the File
This function retrieves all stored book records from the file and displays them in a user-
friendly format. The file is opened in read mode ("r"), and its contents are extracted and
displayed.
➢ ALGORITHM
BOOKS_FILE = "library.txt"
def add_book():
book_name = input("Enter Book Name: ")
author = input("Enter Author Name: ")
price = input("Enter Book Price: ")
def display_books():
try:
with open(BOOKS_FILE, "r") as file:
books = file.readlines()
if not books:
print("No books found!\n")
return
print("\nLibrary Books:")
for book in books:
details = book.strip().split(",")
print(f"Book Name: {details[0]}, Author: {details[1]}, Price: {details[2]}")
except FileNotFoundError:
print("No books found! Add some books first.\n")
def delete_book():
book_name = input("Enter the Book Name to delete: ").strip()
try:
with open(BOOKS_FILE, "r") as file:
books = file.readlines()
found = False
with open(BOOKS_FILE, "w") as file:
for book in books:
details = book.strip().split(",")
if details[0].lower() != book_name.lower():
file.write(book)
else:
found = True
if found:
print(f"Book '{book_name}' deleted successfully!\n")
else:
print(f"Book '{book_name}' not found!\n")
except FileNotFoundError:
print("No books found! Add some books first.\n")
def sort_books():
try:
with open(BOOKS_FILE, "r") as file:
books = [line.strip().split(",") for line in file.readlines()]
if not books:
print("No books found!\n")
return
if choice == "1":
books.sort(key=lambda x: x[0].lower())
elif choice == "2":
books.sort(key=lambda x: float(x[2]))
else:
print("Invalid choice!\n")
return
print("\nSorted Books:")
for book in books:
print(f"Book Name: {book[0]}, Author: {book[1]}, Price: {book[2]}")
except FileNotFoundError:
print("No books found! Add some books first.\n")
while True:
print("\nLibrary Management System")
print("1. Add Book")
print("2. View Books")
print("3. Delete Book")
print("4. Sort Books")
print("5. Exit")
• I understood how file handling works and how to use it effectively in a project.
• Through this project, I learned how to manage and manipulate data using file handling
instead of a database.
• Enhanced logical thinking and problem-solving skills by implementing sorting and
searching functionalities.
• Improve presentation skills.
Annexure–V
Teacher Evaluation Sheet
“Library Management”
Group Members:
Roll Enrollment No. Seat No. Name Remark if any
No.
21 2200120021 Kumbhar Prarthana Ganpati
2 Information Collection
5 Ability to run/debug
21
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
Signature : ……………………………