D.A.
V SENIOR SECONDARY SCHOOL,
(BOYS), MOGAPPAIR, CHENNAI-37
PHYSICS INVESTIGATORY PROJECT
2025-2026
PYTHON-BASED LIBRARY MANAGEMENT
SYSTEM USING FILE HANDLING AND CSV
FOR EFFICIENT BOOK TRACKING AND USER
RECORD MANAGEMENT
Done by, M Lohith
1
BONAFIDE CERTIFICATE
Register No.____________ Internal
Assessment
Certified to be the Bonafide Record work in ____________
done by ___________________ of Class XII, Section A of
D.A.V BOYS SENIOR SECONDARY SCHOOL – BMGP
during the year 2025 to 2026
________________________________ __________________________________
Signature of the Principal Signature of Subject
Teacher
School Seal Designation: PGT/TGT
Submitted for the Practical Exam held on _____________ at
DAV BOYS SENIOR SECONDARY SCHOOL CHENNAI
Internal Examiner External Examiner
Chief Superintendent
Date:
2
PROJECT OVERVIEW
Title Page
Acknowledgement 3
Introduction
System Requirements
Software Description
Modules Used
User Defined Functions
Source Code
Screen Layouts
Bibliography
3
ACKNOWLEDGEMENT
I take this opportunity to express my deep sense of gratitude
to our respected Principal, Smt. Nandhini . S, for providing
the necessary facilities and encouragement to carry out this
project successfully.
I am sincerely thankful to my Computer science teacher, Smt.
S. Jaya, for her valuable guidance, constant support, and
encouragement throughout the completion of this work.
I would also like to extend my heartfelt thanks to our Physics
Lab Assistant, Shri. James A , for his continuous assistance
during the experimental work.
My special thanks are due to my project partners,
B. DHANESH AND M MEYAPPAN VISWANATH, for
their cooperation, teamwork, and dedicated efforts which
made this project possible.
Finally, I am deeply grateful to my friends and parents for
their encouragement, motivation, and unwavering support at
every stage of this project. Without their help and inspiration,
this work would not have been possible.
4
INTRODUCTION
The Library Management System in Python Using CSV File
Handling is a project developed to simplify and automate the
daily operations of a library. It replaces traditional manual
record-keeping with a digital solution that allows efficient
tracking of books and user details. The system is designed
using Python, one of the most popular programming
languages, and makes use of key concepts from the Class XII
Computer Science syllabus such as file handling, functions,
data structures, and exception handling.
This project uses CSV (Comma Separated Values) files to
store and manage data in a tabular format instead of relying
on a complex database. Every time a book is added, removed,
borrowed, or returned, the information is automatically
updated in the CSV file. The program features a multi-user
system that includes both regular users and an admin. The
admin has the privilege to add or remove books, while users
can borrow, return, renew, and search for books.
The project also integrates Python’s datetime module to
automatically assign and manage due dates for borrowed
books. This helps track overdue books and maintain proper
records. To make the system more engaging, it includes a
genre-based recommendation feature, allowing users to
discover books according to their interests.
Overall, this project demonstrates the practical use of Python
in building real-world applications. By combining concepts
like file handling and data storage through CSV, it provides a
reliable and easy-to-use system for efficient library
management. It also encourages the use of programming for
developing simple yet powerful solutions that improve
accuracy, accessibility, and productivity in everyday tasks.
5
SYSTEM REQUIREMENT
6
SOFTWARE DESCRIPTION
PYTHON:
Python is a high-level, object-oriented, interpreted programming
language with dynamic semantics. It is simple, powerful, and easy
to learn, making it ideal for developing real-world applications.
Python supports file handling, functions, and data structures such
as lists and dictionaries, which are used in this project to store and
process library data. Its readability and modularity make it a
popular choice for educational and commercial software
development.
MS WORD:
Microsoft Word is a word-processing software developed by
Microsoft. It is used to prepare the documentation of this project,
including the report, introduction, objectives, and conclusion
pages. It allows editing, formatting, and printing of the final
project document neatly.
MS EXCEL:
Microsoft Excel is a spreadsheet software used for organizing and
presenting data in tabular form. It is useful for opening and
verifying the books.csv and users.csv files created by this
project. It also allows easy modification of stored records if
needed.
7
MODULES USED
TKINTER:
Tkinter is Python’s standard GUI (Graphical User Interface)
library.
It is used in this project to design interactive windows,
buttons, labels, and dialogs.
Functions like messagebox and simpledialog are used for user
interaction such as showing messages, taking input, and
displaying book information in a user-friendly interface.
CSV:
The csv module is used for reading from and writing to
Comma Separated Values (CSV) files.
In this project, it stores and retrieves information about books
and users in tabular form.
It acts as a lightweight database that keeps records of titles,
genres, availability, and borrowers.
OS:
The os module provides functions to interact with the
operating system.
Here, it is used to check whether the required CSV files (like
books.csv and users.csv) exist before loading them.
This prevents runtime errors and ensures smooth execution.
8
DATETIME:
The datetime module is used to handle dates and calculate due
dates for borrowed books.
It helps the system automatically generate, renew, and check
book due dates, and also find overdue books accurately.
TKINTER.MESSAGEBOX & SIMPLEDIALOG:
These submodules of Tkinter are used for displaying pop-up
message boxes and prompting user inputs.
They enhance interactivity by allowing users to easily enter
data and receive system responses without typing in the
console.
9
USER DEFINED FUNCTIONS
ld_bks():
This function loads all the book records from the books.csv
file and stores them in a dictionary.
It checks whether the file exists using the os module and reads
data using the csv.reader() function.
Each book’s title is used as a key, and its details such as
genre, pages, availability, due date, and borrower are stored as
values.
sv_bks(bks):
This function saves all the updated book records back into the
books.csv file.
It writes the current book dictionary data into the CSV file
using csv.writer(), ensuring that all changes such as borrowed,
returned, or added books are stored permanently.
ld_us():
This function loads all registered users from the users.csv file.
It creates a dictionary where each username is stored as a key
and their list of borrowed books as values.
This helps track which user has borrowed which books.
10
sv_us(us):
This function saves all user data, including borrowed book
lists, back into the users.csv file.
It ensures data persistence and updates user information
whenever a book is borrowed or returned.
LibraryApp (Class):
This is the main class of the project.
It controls the entire program flow and contains multiple user-
defined functions (methods) for different operations such as
registration, login, borrowing, returning, renewing, and
displaying books.
Each button in the GUI triggers one of these methods to
perform a specific task.
main_menu(), register(), login(), user_menu():
These methods handle the main user interface of the program.
They display menus, take inputs, and guide the user to
different operations.
They also manage admin and user-level access separately.
11
borrow_book(), return_book(), renew_book():
These functions handle borrowing, returning, and renewing
books.
They update the book availability status, assign or extend due
dates, and save the changes into the CSV files.
show_books(), show_available(), show_all():
These functions display the list of books in the library.
They show available or all books, along with details like title,
genre, pages, and borrower information.
recommend_by_genre(), search_by_title():
These functions help users find and explore books easily.
They allow searching for specific titles or recommending
books from a chosen genre.
overdue_books():
This function checks for overdue books using the datetime
module.
12
It compares today’s date with each book’s due date and
displays all books that are overdue.
add_book(), remove_book():
These are admin-only functions.
They allow the administrator to add new books to the system
or remove old ones from the library database.
display_titles():
To avoid the typo error while inputting the title this function
is used.
They display all the book titles while receiving the input from
the user
13
SOURCE CODE
14
15
SCREEN LAYOUTS
16
BIBLIOGRAPHY
1. NCERT Physics Textbook – Class XII
2. Comprehensive Practical Physics – Class XII
3. Selina Concise Physics Reference Materials
4. Online resources on optics and prism experiments:
o www.physicsclassroom.com
o www.sciencedirect.com
o www.topper.com
17