0% found this document useful (0 votes)
18 views20 pages

Library Management System in Python

The document is a project report by Nagendra Sahu for a Library Management System developed using Python, aimed at automating library operations. It outlines the project's objectives, functionalities, and the programming concepts utilized, including user-defined functions and file handling. The report also includes future enhancements and a bibliography of references used in the project.

Uploaded by

navyagupta1245
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views20 pages

Library Management System in Python

The document is a project report by Nagendra Sahu for a Library Management System developed using Python, aimed at automating library operations. It outlines the project's objectives, functionalities, and the programming concepts utilized, including user-defined functions and file handling. The report also includes future enhancements and a bibliography of references used in the project.

Uploaded by

navyagupta1245
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

istian publi

hr Cs
C C
g

ho
Ewin

ol
SESSION:-2025-26

™6VCE

Submitted To:- Submitted By:-


[Link] Nagendra Sahu
This is to certify that I am Nagendra Sahu Student
of class 12th-A1 has successfully completed the
computer science (083) project.
“Report File”
Under the supervision of my computer teacher
Mrs. [Link] Puring the Academic Year in the
partial fulfillment of the computer science
practical examination.
Conducted by CBSE

Internal Examination External Examination


_________________ __________________
A
I would like to express my heartfelt gratitude to my
computer science teacher [Link] valuable
guidance, support, and encouragement throughout the
completion of this Python project. I am also thankful to
my parents for providing the necessary facilities and
motivation.
This project on “Library Management System using
Python” helped me to enhance my knowledge of Python
programming, its concepts, and real-world
applications. It was a great learning experience that
improved my logical thinking and problem-solving
skills.
I sincerely thank everyone who contributed directly or
indirectly to this project’s success.
Serial Number Content Page Number

1. Introduction 1

2. Objective 2

3. About Python 3

4. Function Used 4

5. Modules Used 5

6. Source Code 6-9

7. Output 10-12

8. Conclusion 13

9. Hardware And 14
Software
10. Future Scope 15

11. Bibliography 16
A Library Management System (LMS) is a software
application designed to manage the day-to-day
operations of a library efficiently. It helps librarians
and users handle various library activities such as
cataloging books, maintaining records of issued and
returned books, tracking due dates, and managing
member information.
The main objective of an LMS is to simplify library
operations, reduce manual effort, and improve
accuracy. It allows librarians to easily store, retrieve,
and update data related to books and users. With the
help of this system, users can quickly search for books
by title, author, or subject, while librarians can monitor
the availability and circulation of books.
Overall, the Library Management System enhances the
efficiency of library services, saves time, minimizes
human errors, and ensures better organization of
library resources.

1 Nagendra Sahu(Xll-A1)
The main objective of the Library Management System is to
automate the library’s operations and make the management
of books and user records more efficient and accurate. It aims
to reduce the manual work of librarians by providing a
computerized system for maintaining details of books,
members, issue/return transactions, and fines.
Key objectives include:
• To maintain accurate records of all books and members.

• To simplify the process of issuing, returning, and

searching for books.


• To save time and effort by automating routine library

tasks.
• To reduce errors caused by manual record keeping.

• To improve accessibility, allowing quick retrieval of book

information.
• To enhance library services through better data

organization and management.

2 Nagendra Sahu(Xll-A1)
About Python
 Python is a high-level, interpreted
programming language created by
Guido van Rossum in 1991.
 It is simple, readable, and easy to
learn for beginners.
 Python supports object-oriented,
procedural, and functional
programming styles.
 It is open-source and works on
multiple platforms like Windows, macOS, and Linux.
 Python has a large standard library for various tasks such as
math, file handling, and web development.
 It is widely used in data science, AI, web development, automation,
and game development.
 Python’s simplicity and power make it one of the most popular
programming languages today.
Example:
# Simple Python Program
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
print("Sum =", a + b)
• Advantages: Easy to read, portable, and powerful.
• Disadvantages: Slower execution and not ideal for mobile apps.
# Python is simple, versatile, and widely used everywhere!

3 Nagendra Sahu(Xll-A1)
 add_book() – This function allows the librarian to
add new books to the record. It takes the book ID, book
sname, author name, and quantity from the user and
stores them in a text file named [Link] using file
handling in append mode.
 display_books() – This function displays all books
stored in the file in a proper table format. It reads each
line, separates the data using commas, and shows
details like Book ID, Name, Author, and Quantity.
 issue_book() – This function is used when a user
wants to issue a book. It searches for the entered Book
ID in the file, checks if the book is available, and
reduces its quantity by one if it is in stock.
 return_book() – This function is called when a book
is returned to the library. It increases the book’s
quantity by one in the record.
 main_menu() – This function manages the program
flow. It displays the menu options, takes user input, and
calls the appropriate functions.

4 Nagendra Sahu(Xll-A1)
1. Only one type of module is used in this project — the
user-defined module.
2. No external or built-in modules such as os, json, or csv
are imported in the code.
3. The program is completely based on core Python
features like file handling, loops, and conditionals.
4. A user-defined module means a collection of functions
created by the programmer to perform related tasks.
5. In this project, the functions add_book(),
display_books(), issue_book(), return_book(), and
main_menu() together make up the user-defined module.
6. Each function performs a specific task — adding,
viewing, issuing, returning books, or controlling the main
menu.
7. Built-in Python functions such as open(), read(), write(),
input(), and print() are used but do not require importing
any module.
8. Since no library or external dependency is used, the
project remains simple and easy to execute on any
computer.
9. The use of only user-defined functions makes the code
well-structured and organized.
10. Final Conclusion: This project uses only one
module type — user-defined module, supported by
Python’s basic built-in functions.

5 Nagendra Sahu(Xll-A1)
# Function to add a new book to the library

def add_book():
book_id = input("Enter Book ID: ")
book_name = input("Enter Book Name: ")
author = input("Enter Author Name: ")
qty = input("Enter Quantity: ")

with open("[Link]", "a") as f:


data=(book_id + "," + book_name + "," + author + "," + qty + "\n")
[Link](data)
print("Book added successfully!\n")

# Function to display all books in the library

def display_books():
print("\n List of Books:")
try:
with open("[Link]", "r") as f:
lines = [Link]()
if not lines:
print("No books available.\n")
return
print("ID\tName\t\tAuthor\t\tQty")
print("-" * 70)
for line in lines: 6
book_id, name, author, qty = [Link]().split(",")
print(f"{book_id}\t{name}\t\t{author}\t\t{qty}")
except FileNotFoundError:
print("No library record found!\n")

# Function to issue (borrow) a book

def issue_book():
book_id = input("Enter Book ID to issue: ")
found = False
lines = []

try:
with open("[Link]", "r") as f:
lines = [Link]()

with open("[Link]", "w") as f:


for line in lines:
b_id, name, author, qty = [Link]().split(",")
if b_id == book_id:
found = True
if int(qty) > 0:
qty = str(int(qty) - 1)
print(f" Book '{name}' issued successfully!")
else:
print(" Book not available (out of stock).")
data=(b_id + "," + name + "," + author + "," + qty + "\n")
[Link](data)
if not found: 7
print(" Book ID not found.\n")

except FileNotFoundError:
print("No library record found!\n")

# Function to return a book

def return_book():
book_id = input("Enter Book ID to return: ")
found = False
lines = []
try:
with open("[Link]", "r") as f:
lines = [Link]()
with open("[Link]", "w") as f:
for line in lines:
b_id, name, author, qty = [Link]().split(",")
if b_id == book_id:
found = True
qty = str(int(qty) + 1)
print(f" Book '{name}' returned successfully!")
data=(b_id + "," + name + "," + author + "," + qty + "\n")
[Link](data)
if not found:
print(" Book ID not found.\n")
except FileNotFoundError:
print("No library record found!\n")

# Main menu function to interact with the user 8


def main_menu():
while True:
print("\n====== Library Management System ======")
print("1. Add Book")
print("2. Display Books")
print("3. Issue Book")
print("4. Return Book")
print("5. Exit")
choice = input("Enter your choice (1-5): ")

# Call corresponding function based on user choiced

if choice == '1':
add_book()
elif choice == '2':
display_books()
elif choice == '3':
issue_book()
elif choice == '4':
return_book()
elif choice == '5':
print(" Exiting... Have a great day!")
break
else:
print(" Invalid choice! Please try again.\n")

# Run the program


main_menu() 9
❖ Add Book:-

10 Nagendra Sahu(Xll-A1)
❖ Display Book:-

❖ Issue Book:-

11 Nagendra Sahu(Xll-A1)
❖ Return Book:-

❖ Exit:-

12 Nagendra Sahu(Xll-A1)
1. The Library Management System project efficiently
manages library operations using Python.
2. It allows the user to add books, display books,
issue books, and return books through a simple
menu.
3. The project is built using user-defined functions,
making the code organized and easy to understand.
4. Core Python features like file handling (open(),
read(), write()), loops, and conditional statements
are used without any external modules.
5. No modules like os, json, or csv are required,
keeping the program simple and lightweight.
6. Using a text file ([Link]) ensures that book
records are stored permanently and can be updated
as needed.
7. The menu-driven interface allows multiple
operations without restarting the program.
8. This project helps students understand real-world
applications of Python, program flow, and
structured coding.
9. Overall, it is a practical and effective solution for
managing library operations digitally.

13 Nagendra Sahu(Xll-A1)
hardwarE and softwarE
rEquirEmEnt
• Hardware:-
13th Gen intel(R) Core(TM) i5-1334U(1.30GHz)
16 GB RAM
Storage:- 954 free space
Printer for printing project.
CD Drive or pendrive 4 GB

• Software:-
Modern Operating System
Windows 10
Python 3.12.7 or newer for Execution of Project.
Notepad for writing steps.

14 Nagendra Sahu (Xll-A1)


GUI Implementation: The current program uses a command-line
interface. In the future, it can be enhanced with a Graphical User
Interface (GUI) using Tkinter, PyQt, or other Python libraries,
making it more user-friendly.
 Database Integration: Instead of using a text file, the system
can be upgraded to use databases like MySQL, SQLite, or
PostgreSQL for faster data access, better storage, and advanced
queries.
 Online Access: The system can be developed as a web-based
library management system using frameworks like Django or
Flask, allowing users to access the library remotely.
 Advanced Features: Features such as book search,
categorization, late fee calculation, notifications, and user
authentication can be added to make it more efficient.
 Reports and Analytics: The system can generate daily, weekly,
or monthly reports on issued and returned books and provide
analytics for better management.
 Mobile Application: A mobile version of the system can be
developed to allow students and staff to search, issue, or return
books from smartphones.
 Integration with Barcode/RFID: For faster operations,
barcode or RFID scanning can be integrated to issue or return
books automatically.
 Cloud Storage: Future versions can use cloud storage to store
data securely and allow multiple libraries to share resources.

15 Nagendra Sahu(Xll-A1)
• Python Programming” by Reema Thareja, Oxford
University Press, 2020.
• “Computer Science with Python” by Sumita Arora,

Dhanpat Rai & Co., 2021.


 Websites:
• Python Official Documentation:

[Link]
• TutorialsPoint Python File Handling:

[Link]
m
• GeeksforGeeks Python Projects:

[Link]
 Journals/Articles:
• “Applications of Python in Real-World Projects,”

International Journal of Computer Science, 2021.


 Other References:
• Sample Python projects and CBSE Class 12 practical

files from previous years.

16 Nagendra Sahu(Xll-A1)

You might also like