0% found this document useful (0 votes)
12 views22 pages

Library Management System in Python

The document presents a mini project report on a Library Management System developed using Python and MySQL by students from the Gandhi Institute of Technological Advancement. It includes project analysis, functions and modules, detailed descriptions of database tables, source code, and outputs related to the system. The project aims to enhance efficiency and user satisfaction for a public library named 'READING COMMUNITY'.
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)
12 views22 pages

Library Management System in Python

The document presents a mini project report on a Library Management System developed using Python and MySQL by students from the Gandhi Institute of Technological Advancement. It includes project analysis, functions and modules, detailed descriptions of database tables, source code, and outputs related to the system. The project aims to enhance efficiency and user satisfaction for a public library named 'READING COMMUNITY'.
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

lOMoARcPSD|50941792

Library Management System Using Python AND MY SQL

Computer science (Gandhi Institute for Technological Advancement)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Parichit 2008 (parichitponia2008@[Link])
lOMoARcPSD|50941792

LIBRARY
MANAGEMENT
SYSTEM
Using Python and mySQL

GANDHI INSTITUTE OF TECHNOLOGICAL ADVANCEMENT (GITA),


BHUBANESWAR, ODISHA-752054, INDIA

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

LIBRARY MANAGEMENT SYSTEM USING


PYTHON AND MY SQL

Project ID: xxxxxx


A Mini Project Report
Submit for fulfilment of the requirements for the
Degree of Bachelor of Technology
Under GITA Autonomous College, Bhubaneswar

Submitted By

Susil Kumar Sahu


Roll No: #CSIT2105058
Prabhupada Nayak
Roll No: #CSIT2105035

May- 2023

Under the guidance of

Dr. Parimal Kumar Giri

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

GANDHI INSTITUTE OF TECHNOLOGICAL ADVANCEMENT


(GITA), BHUBANESWAR, ODISHA-752054, INDIA

CERTIFICATE
This is to certify that the project work entitled ‘LIBRARY MANAGEMENT SYSTEM
USING PYTHON AND MY SQL xxxxxx’ is a bonafide work being SUSIL KUMAR
SAHU and PRABHUPADA NAYAK bearing Registration No. #2101287387 and
Registration No. #2101287366 of B. Tech CSIT branch.

This project report is submitted in partial fulfillment for the requirement of the [Link] degree
under Gandhi Institute of Technological Advancement (GITA), Bhubaneswar, Odisha.

Project Coordinator Date Project Guide

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

Acknowledgem
ent
I would like to take this opportunity to thank all those individuals whose invaluable
contribution in a direct or indirect manner has gone into the making of this mini project a
tremendous learning experience for me.

It is my proud privilege to epitomize my deepest sense of gratitude and indebtedness to my


faculty guide, Prof. / Dr. xyz for his valuable guidance, keen and sustained interest, intuitive
ideas and persistent endeavour. His guidance and inspirations enabled me to complete my
report work successfully.

I give my sincere thanks to Prof./Dr. xyz, Project Coordinator and Dr. Parimal Kumar Giri,
HOD CSIT for giving me the opportunity and motivating me to complete the project within
stipulated period of time and providing a helping environment.

I acknowledge with immense pleasure the sustained interest, encouraging attitude and
constant inspiration rendered by Prof. (Dr.) M.K. Roul (Principal), GITA Autonomous.
Their continued drive for better quality in everything that happens at GITA and selfless
inspiration has always helped us to move ahead.

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

Susil Kumar Sahu


Prabhupada Nayak

PROJECT ON
LIBRARY MANAGEMENT
SYSTEM
2021-25

Group members:

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

• Susil Kumar
Sahu
•Pra
bhupada Nayak

INDEX
Particulars Page
[Link].
1 06
Project Analysis

2 Functions and modules 07

3 Detailed Description 10
4 Source Code 11
5 Outputs And Tables 15
6 Bibliography 18
remarks 19
7

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

PROJECT ANALYSIS
Our application program is specially
designed for the public library named
"READING COMMUNITY."

They lend books to readers who have subscribed


with the library.

We have tried to maximise the efficiency and strived for customer and
user ease as well as satisfaction.

We have thoroughly examined the needs of the library and after the
analysis, we have constructed the program.

We have used PYTHON and MYSQL as our platform

to carry out this task.

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

functions and modules

modules:

import [Link]:

By importing this package,we are able to establish the


connection between SQL and PYTHON.

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

FUNCTIONS:

connect():
This function establishes connection between Python
andMySQL.

cursor():
It is a special control structure that facilitates the row-by- row
processing of records in the result set.
The Syntax is:
<cursor object>=<connection object>.cursor()

execute():
This function is used to execute the sql query and retrieve
records using python.
The syntax is:
<cursor object>.execute(<sql query string>)

def():
A function is a block of code which only runs when it is
called.

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

fetchall():
This function will return all the rows from the result set in the
form of a tuple containing the records.
fetchone():
This Function will return one row from the result set in the
form of a tuple containing the records.
commit():
This function provides changes in the database physically.

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

DETAILED
DESCRIPTION

*) Our Project has 3 MySQL tables. These are:-


1.) Books
2.) Issue
3.) Submit
1) The table Books contain the following columns:
a) bname
b) bcode
c) total
d) subject
2.) The table Issue contain the following columns:
a.) name
b.) regno
c.) bcode
d.) issue_date
3.) The table Return contain the following columns:
a.) name
b.) regno
c.) bcode
d.) submit_date

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

source code
for mysql:

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

Source code
For python:
import [Link] as a
con=[Link](host="localhost",user="root",passwd="Susil@1@2@3",database="libr
ary1")

def addbook():
bn=input("enter the book name : ")
c=input("enter the book code : ")
t=input("total book : ")
s=input("enter subject : ")
data=(bn,c,t,s)
sql='insert into books values(%s,%s,%s,%s)'
c=[Link]()
[Link](sql,data)
[Link]()
print(">---------------------------------------------------------------<")
print("DATA ENTERED SUCCESSFULLY")
main()
def issueb():
n=input("enter the name : ")
r=input("enter the reg no : ")
co=input("enter book code : ")
r=input("enter the reg no : ")
d=input("enter date : ")
a="insert into issue values(%s,%s,%s,%s)"
data=(n,co,r,d)
c=[Link]()
[Link](a,data)
[Link]()
print(">---------------------------------------------------------------<")
print("Book Issued To :",n)
bookup(co,-1)
def submitb():
n=input("enter the name : ")
r=input("enter the reg no : ")
co=input("enter book code : ")
d=input("enter date : ")
data=(n,r,co,d)
a='insert into submit values(%s,%s,%s,%s)'
c=[Link]()
[Link](a,data)
[Link]()

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

print(">---------------------------------------------------------------<")
print("Book submitted from :",n)
bookup(co,-1)
def bookup(co,u):
a="select TOTAL from books where BCODE = %s"
data=(co,)
c=[Link]()
[Link](a,data)
myresult=[Link]()
t=myresult[0] + u
sql="update books set TOTAL = %s where BCODE =%s"
d=(t,co)
[Link](sql,d)
[Link]()
main()
def dbook():
ac=input("enter book code")
a="delete from books where BCODE=%s"
data=(ac,)
c=[Link]()
[Link](a,data)
[Link]()
main()
def dispbook():
a="select* from books"
c=[Link]()
[Link](a)
myresult=[Link]()
for i in myresult:
print("book name : ",i[0])
print("book code : ",i[1])
print("total : ",i[2])
print(">---------------------------------------------------------<")
main()
def main():
print("""

LIBRARY MANAGER

[Link] BOOK
[Link] BOOK
[Link] BOOK
[Link] BOOK
[Link] BOOKS
""")

choice=int(input("Enter Task No : "))

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

print(">----------------------------------------------------------------
<")
if(choice==1):
addbook()
elif(choice==2):
issueb()
elif(choice==3):
submitb()
elif(choice==4):
dbook()
elif(choice==5):
dispbook()
else:
print("wrong choice.........")
main()
def pswd():
ps=input("enter password : ")
if(ps=="Susil@1@2@3"):
main()
else:
print("Wrong password")
pswd()
pswd()

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

outputs and tables


Outputs:
1.)Add a book:

2.)issue a book:

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

3.)Submit the book:

4.)delete the book:

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

5.)display the books:

TABLES:
1.)select * from books:

2.)select * from issue:

3.)select * from submit:

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

BIBLIOGRAPHY
 To develop this project many
references are used
[Link]://[Link]
[Link]://[Link]

Downloaded by Parichit 2008 (parichitponia2008@[Link])


lOMoARcPSD|50941792

Remark

Downloaded by Parichit 2008 (parichitponia2008@[Link])

Common questions

Powered by AI

To issue a book, the issueb() function collects member and book details, inserts a new record into the 'Issue' table, and decrements the 'total' field in the 'Books' table. Returning a book involves the submitb() function which logs the return in the 'Submit' table and increments the 'total' field in the 'Books' table. SQL operations used include INSERT for adding records and UPDATE for adjusting book totals .

Python and MySQL are effective choices for developing the Library Management System due to Python's simplicity and the robust database management capabilities of MySQL. Python offers ease of coding and integration with MySQL, allowing straightforward execution of SQL commands. MySQL provides a reliable relational database platform that efficiently manages and manipulates large datasets, ensuring data integrity and swift access to library records .

The Library Management System provides functionalities such as adding books, issuing books to members, submitting books, deleting books, and displaying the list of books available in the library. These operations are executed using MySQL queries executed through Python functions such as addbook(), issueb(), submitb(), dbook(), and dispbook().

When a book is adde d, the addbook() function inserts the new book details into the 'Books' table. If a book is removed, the dbook() function deletes the book from the table based on the provided bcode. In both cases, the system updates the database to reflect these changes, ensuring the 'Books' table always holds accurate information about the library's inventory .

The system implements a basic security measure through password protection. The pswd() function requires users to enter a correct password before accessing the main menu of the library system functionalities. This simple authentication step ensures only authorized users have access to the management features .

The connect() function establishes a connection between the Python program and the MySQL database. The cursor() function creates a cursor object that allows for interaction with the database through executing SQL queries. The execute() function runs SQL queries using the cursor, enabling data retrieval and manipulation operations such as fetching records or updating tables .

Challenges in implementing fetching functions like fetchall() and fetchone() include handling large datasets that could lead to high memory consumption when fetching all records at once, which may degrade system performance. Additionally, ensuring efficient cursor management to avoid locking or contention issues and accurately handling empty result sets or NULL values require careful coding practices and testing .

The database schema consists of three tables: 'Books', 'Issue', and 'Submit'. The 'Books' table includes fields such as bname (book name), bcode (book code), total (total number of copies), and subject. The 'Issue' table contains name, regno (registration number), bcode, and issue_date. The 'Submit' table has similar fields: name, regno, bcode, and submit_date, which record the details of book submissions .

The system enhances user satisfaction by streamlining the book lending process, minimizing manual errors, and providing quick access to information like book availability and member details. Operational efficiency is achieved through automated processes that include real-time database updates, easy data retrieval using SQL queries, and intuitive user interfaces that simplify tasks for library staff and members .

The system maintains data consistency by updating the 'TOTAL' column in the 'Books' table whenever a book is issued or returned. The bookup() function retrieves the current total of books available using a SELECT query, adjusts the count by adding or subtracting depending on the operation, and then updates the record using an UPDATE query. This ensures that the system always reflects the accurate number of available copies .

You might also like