0% found this document useful (0 votes)
15 views

CS Proj Finallast

The document outlines a Library Management System (LMS) project developed by Shreyak Kadam using Python and MySQL, aimed at automating library operations such as book management, issuing, and returning books. It includes sections on objectives, scope, hardware and software used, code implementation, user manual, and a pros and cons analysis of the system. The project emphasizes improving efficiency and organization in library management while acknowledging limitations in user interface and functionality.

Uploaded by

kadamshreyak
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)
15 views

CS Proj Finallast

The document outlines a Library Management System (LMS) project developed by Shreyak Kadam using Python and MySQL, aimed at automating library operations such as book management, issuing, and returning books. It includes sections on objectives, scope, hardware and software used, code implementation, user manual, and a pros and cons analysis of the system. The project emphasizes improving efficiency and organization in library management while acknowledging limitations in user interface and functionality.

Uploaded by

kadamshreyak
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
You are on page 1/ 35

INVESTIGATORY

PROJECT

LIBRARY MANAGEMENT
SYSTEM

1
Shri Bhairavnath Shikshan Sanstha’s
Aditya English Medium School
Affiliation No. 1130831
Baner, Pune

Certificate

This is to certify that Shreyak kadam of class 12-B of


Aditya English Medium School has successfully
completed project under the guidance of Varsha maam
during the academic year 2024-25

Principal sign External sign Teacher sign

2
Acknowledgement
I would like to express my special thanks of gratitude to
my teacher
Varsha maam ,who gave me the golden opportunity to
do this wonderful project. For the subject Computer
science on Library management system
I am also thankful to our principal for supporting me. I
came to know about so many things.
I would also like to thank my parents who were very
supportive during this process. Thank you

Yours Faithfully
Shreyak Kadam

3
INDEX
Sr No Name Pg No
1 Introduction 5
2 Objective 6
3 Scope 7
4 Hardware/Software used 8
5 Theory 9
6 Flowchart 11
7 MySQL code 12
8 Python code 14
9 Output 22
10 User Manual 27
11 Pros and Cons 29
12 Conclusion 33
13 Bibliography 35

4
INTRODUCTION

The Library Management System (LMS) project


uses Python and MySQL to build an easy-to-use
tool for managing a library's operations. By
combining Python's programming power with
MySQL's database features, this project helps
manage tasks like keeping track of books,
handling user accounts, monitoring book loans,
and creating reports. It allows efficient storage and
retrieval of library data, making it simpler for both
library staff and users to interact with the system.

In this project, Python is used to connect to the


MySQL database, allowing the system to perform
various actions such as searching for books,
updating information, and deleting records. The
goal is to create a straightforward system that
improves how libraries manage their resources
and services. Python's flexibility and MySQL's
robust database management work together to
make library operations smoother and more
efficient.

5
Objective:

The objective of the Library Management System


project is to develop a user-friendly and efficient
software application that automates the
management of library operations. This system will
streamline tasks such as adding new books,
issuing and returning books, deleting outdated
records, and generating reports on issued and
returned books. By leveraging Python and MySQL,
the system aims to reduce manual effort, minimize
errors, and provide quick access to information,
making library management more organized and
effective.

6
Scope:

The scope of this project includes the development


of various modules such as book management,
book issuing, book returning, and report
generation. The system will handle student and
book details, track the status of issued books, and
update the inventory accordingly. It will also
provide an interface for the librarian to manage the
library’s operations efficiently. This project can be
further expanded to include features like user
authentication, fine calculation, and digital book
tracking.

7
HARDWARE USED

Device name DESKTOP-KMUUHQ4


Processor Intel(R) Core(TM) i7-7500U CPU @
2.70GHz 2.90 GHz
Installed RAM 16.0 GB
Device ID
A055CCC6-585C-48BF-B078-F08BC5C5D819
Product ID 00330-80000-00000-AA434
System type 64-bit operating system,
x64-based processor
Pen and touch No pen or touch input is available
for this display

SOFTWARE USED

Edition Windows 11 Pro


Version 21H2
Installed on ‎19-‎09-‎2022
OS build 22000.2538
Experience Windows Feature Experience Pack
1000.22001.1000.0

8
THEORY

What is Python?

Python is a high-level, interpreted programming


language known for its simplicity and readability. It
supports multiple programming paradigms,
including procedural, object-oriented, and
functional programming. Python's extensive
standard library and community-contributed
modules make it versatile for a wide range of
applications, from web development to data
analysis and automation.

What is File Handling?

File handling in programming refers to the process


of opening, reading, writing, and closing files
stored on a computer. In Python, file handling is
done using built-in functions like `open()`, `read()`,
`write()`, and `close()`. This allows developers to

9
interact with files, store data, and retrieve
information efficiently.

What is Database?

A database is an organized collection of structured


information or data, typically stored electronically.
It allows for efficient storage, retrieval,
modification, and management of data. Databases
are crucial for applications requiring large-scale
data handling and are managed using Database
Management Systems (DBMS) like MySQL,
Oracle, and PostgreSQL.

What is MySQL?

MySQL is an open-source relational database


management system (RDBMS) that uses
Structured Query Language (SQL) for accessing
and managing data. Known for its reliability,
scalability, and ease of use, MySQL is widely used
in web applications, data warehousing, and for
managing large-scale databases.

10
FLOWCHART

11
CODE

SOURCE CODE

For MySQL:

CREATE DATABASE library_app;

USE library_app;

CREATE TABLE books (


bname VARCHAR(50),
author VARCHAR(50),
bcode INT(4),
total INT DEFAULT 0,
subject VARCHAR(50),
PRIMARY KEY (bcode)
);

CREATE TABLE issue (


name VARCHAR(50),
registration_name VARCHAR(50),
bcode INT(4),

12
issue_date DATE,
return_date DATE,
contact_email VARCHAR(50),
PRIMARY KEY (registration_name, bcode,
issue_date)
);

CREATE TABLE book_return (


name VARCHAR(50),
registration_name VARCHAR(50),
bcode INT(4),
return_date DATE,
fine INT DEFAULT 0,
PRIMARY KEY (registration_name, bcode,
return_date)
);

SELECT * FROM books;


SELECT * FROM issue;
SELECT * FROM book_return;

13
For Python:
import mysql.connector as a
from datetime import datetime, timedelta

con = a.connect(host='localhost', user='root',


passwd='passwordshrekyy',
database='library_app')

def addbook():
bn = input("Enter Book Name: ")
ba = input("Enter Author's Name: ")
c = int(input("Enter Book Code (4-digit): "))
s = input("Enter Subject: ")
data = (bn, ba, c, s)
sql = 'INSERT INTO books (bname, author,
bcode, subject) VALUES (%s, %s, %s, %s);'
cursor = con.cursor()
cursor.execute(sql, data)
con.commit()
print("\nBook Added Successfully.\n")
input("Press enter to continue.....\n")
main()

def issueb():
n = input("Enter Student Name: ")
reg_name = input("Enter Registration Name: ")

14
email = input("Enter Contact Email Address: ")
co = int(input("Enter Book Code (4-digit): "))
issue_date = input("Enter Issue Date
(DD-MM-YYYY): ")
issue_date = datetime.strptime(issue_date,
'%d-%m-%Y').date()
return_date = issue_date + timedelta(days=7)
data = (n, reg_name, co, issue_date,
return_date, email)
a = "INSERT INTO issue (name,
registration_name, bcode, issue_date,
return_date, contact_email) VALUES (%s, %s, %s,
%s, %s, %s);"
cursor = con.cursor()
cursor.execute(a, data)
con.commit()
print(f"\nBook issued successfully to: {n}")
print(f"Return Date: {return_date}")
input('Press enter to continue.....\n')
bookup(co, -1)
main()

def returnb():
n = input("Enter Student Name: ")
reg_name = input("Enter Registration Name: ")
co = int(input("Enter Book Code (4-digit): "))

15
return_date = input("Enter Return Date
(DD-MM-YYYY): ")
return_date = datetime.strptime(return_date,
'%d-%m-%Y').date()

cursor = con.cursor()
cursor.execute("SELECT issue_date FROM
issue WHERE registration_name = %s AND bcode
= %s;", (reg_name, co))
result = cursor.fetchone()

if result:
issue_date = result[0]
expected_return_date = issue_date +
timedelta(days=7)
delta = (return_date -
expected_return_date).days

fine = 0
fine_details = ""
if delta > 0:
fine = 100 + ((delta - 1) // 3) * 50
fine_details = f"Fine Calculation:\nBase
Fine: 100 Rupees\nLate Days: {delta}\nAdditional
Fine: {((delta - 1) // 3) * 50} Rupees\nTotal Fine:
{fine} Rupees"

16
a = "INSERT INTO book_return (name,
registration_name, bcode, return_date, fine)
VALUES (%s, %s, %s, %s, %s);"
data = (n, reg_name, co, return_date, fine)
cursor.execute(a, data)
con.commit()
if fine > 0:
print(f"Book returned by: {n} with fine: {fine}
Rupees")
print(fine_details)
else:
print(f"Book returned by: {n} without any
fine.")
else:
print("No record found for the issued book.")

bookup(co, 1)
input("Press enter to continue.....\n")
main()

def bookup(co, u):


cursor = con.cursor()
cursor.execute("SELECT total FROM books
WHERE bcode = %s;", (co,))
myresult = cursor.fetchone()

17
t = myresult[0] + u
sql = "UPDATE books SET total = %s WHERE
bcode = %s;"
cursor.execute(sql, (t, co))
con.commit()
input('Press enter to continue.....\n')
main()

def dbook():
ac = int(input("Enter Book Code (4-digit): "))
a = "DELETE FROM books WHERE bcode =
%s;"
cursor = con.cursor()
cursor.execute(a, (ac,))
con.commit()
print("Book deleted successfully")
input("Press enter to continue.....\n")
main()

def dispbook():
cursor = con.cursor()
cursor.execute("SELECT * FROM books;")
myresult = cursor.fetchall()
for i in myresult:
print(f"Book name: {i[0]}")
print(f"Author: {i[1]}")

18
print(f"Book code: {i[2]}")
print(f"Total: {i[3]}")
print(f"Subject: {i[4]}")
print('\n')
input('Press enter to continue.....\n')
main()

def report_issued_books():
cursor = con.cursor()
cursor.execute("SELECT * FROM issue;")
myresult = cursor.fetchall()
for i in myresult:
print(i)
input("Press enter to continue.....\n")
main()

def report_return_books():
cursor = con.cursor()
cursor.execute("SELECT * FROM
book_return;")
myresult = cursor.fetchall()
for i in myresult:
print(i)
input('Press enter to continue.....\n')
main()

19
def main():
print("""
LIBRARY MANAGEMENT APPLICATION
1. ADD BOOK
2. ISSUE OF BOOK
3. RETURN OF BOOK
4. DELETE BOOK
5. DISPLAY BOOKS
6. REPORT MENU
7. EXIT PROGRAM
""")
choice = input("Enter Task No: ")

if choice == '1':
addbook()
elif choice == '2':
issueb()
elif choice == '3':
returnb()
elif choice == '4':
dbook()
elif choice == '5':
dispbook()
elif choice == '6':
print("""
REPORT MENU

20
1. ISSUED BOOKS
2. RETURNED BOOKS
3. GO BACK TO MAIN MENU
""")
choice = input("Enter Task No: ")
if choice == '1':
report_issued_books()
elif choice == '2':
report_return_books()
elif choice == '3':
main()
else:
print("Please try again.")
main()
elif choice == '7':
print("Thank you and have a great day
ahead.")
else:
print("Please try again.")
main()

main()

21
OUTPUT
Add book:

22
Issue book:

23
If book returned on time:

If book not returned on time:

24
Delete book and displaying new current books:

25
Issued books by users:

Returned books by user:

Exit:

26
USER MANUAL

Installing python and MySQL

Windows
1.Download Python:
○ Visit the official Python website.
○ Download the latest version for Windows.
2.Run the Installer:
○ Double-click the downloaded installer.
○ Check the box "Add Python to PATH" at
the bottom of the installation window.
○ Click "Install Now" and follow the prompts.
3.Verify Installation:
○ Open Command Prompt (cmd).
○ Type python --version and press
Enter. You should see the Python version
number.

27
○ Type pip --version to check if pip
(Python's package installer) is installed.

Windows
1.Download MySQL Installer:
○ Visit the MySQL website.
○ Download the MySQL Installer for
Windows.
2.Run the Installer:
○ Double-click the downloaded installer.
○ Choose the setup type: "Developer
Default" is recommended.
○ Follow the prompts to install MySQL and
MySQL Workbench.
3.Configure MySQL:
○ Set the root password during installation.
○ Complete the configuration wizard.
4.Verify Installation:
○ Open Command Prompt and type mysql
-u root -p, then enter the root
password to log in.

28
PROS AND CONS

Pros
1.Practical Application:
○ Provides hands-on experience with
database management and programming.
○ Useful for understanding CRUD (Create,
Read, Update, Delete) operations.
2.Skill Development:
○ Enhances skills in Python programming
and MySQL database management.
○ Provides exposure to integrating Python
with SQL databases.
3.Customizability:
○ Can be tailored to meet specific
requirements or extended with additional
features.

29
○ Easy to modify or expand, such as adding
new features or improving the user
interface.
4.Real-world Relevance:
○ Useful in real-world applications, as many
organizations use library management
systems.
○ Helps understand concepts used in actual
library management software.
5.Data Integrity:
○ Maintains data consistency through the
use of SQL transactions and queries.
○ Ensures accurate record-keeping for
books and transactions.
6.User Interaction:
○ Provides an opportunity to design user
interactions and handle input validation.
○ Offers a simple interface to interact with
the library database.

Cons
1.Limited User Interface:
○ The project relies on command-line input,
which can be less user-friendly compared
to graphical user interfaces (GUIs).

30
○ Limited visual appeal and may not be
suitable for users unfamiliar with
command-line operations.
2.Basic Functionality:
○ Lacks advanced features like search
functionality, user authentication, and
advanced reporting.
○ May require additional development to
handle more complex requirements.
3.Scalability Issues:
○ Designed for small-scale use; may not
perform well with large volumes of data or
users.
○ May need optimization for performance
and scalability in a production
environment.
4.Error Handling:
○ Basic error handling might not cover all
possible issues, leading to potential
crashes or data inconsistencies.
○ Requires careful validation of inputs and
handling of edge cases.
5.Security Concerns:
○ Basic implementation may lack robust
security measures, such as data
encryption or secure user authentication.

31
○ Potential risks if sensitive data is not
properly secured.
6.Maintenance:
○ Requires ongoing maintenance to fix bugs
and update the code as needed.
○ May require periodic updates to ensure
compatibility with new versions of Python
or MySQL.

32
CONCLUSION

ADDITIONAL THINGS WHICH CAN BE ADDED

Book Reservation: Allow users to reserve books.


Barcode Scanning: Use barcodes for quick
checkouts and returns.
Mobile Access: Create a mobile-friendly version
or app.
User Reviews: Enable book ratings and reviews.
Branch Management: Support multiple library
branches.

33
The Library Management System project shows
how to use Python and MySQL to manage books
and transactions. It helps you learn about adding,
issuing, returning, and deleting books from a
database. Although the system works well for
small-scale use, there’s room to add more features
like a user-friendly interface and better error
handling. This project provides practical
experience with programming and databases, and
it’s a good start for understanding how these
technologies work together. Improving the system
with new features and better security can make it
more useful and reliable.

34
BIBLIOGRAPHY

Sumit arora textbook


https://www.google.com/url?sa=t&rct=j&q=&esrc=s
&source=web&cd=&cad=rja&uact=8&ved=2ahUK
EwihyuK2pPeHAxV7z6ACHfkKPPMQFnoECBkQ
Aw&url=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fwww.analyticsvidhya.c
om%2Fblog%2F2022%2F07%2Flibrary-managem
ent-system-using-mysql%2F%23%3A~%3Atext%3
DSome%2520popular%2520and%2520widely%25
20used%2C%252C%2520SirsiDynix%252C%252
0and%2520Innovative%2520Interfaces.&usg=AOv
Vaw3znBR6wxZEJ6xjS0Gz1JhF&opi=89978449
Library management system example

35

You might also like