You are on page 1of 18

_________ Management System

SESSION 2023-24
COMPUTER SCIENCE (083) XII
---------------------------------------------------------------

A PROJECT REPORT ON

_______________________________________

Submitted By: - Submitted to:-

Name: YOUR NAME Ms.

Roll No:
CERTIFICATE

This is to certify that _______________ of class


XII-__ has successfully completed the project
on the topic “_______ MANAGEMENT
SYSTEM “ under the guidance of Ms. ________
during academic session 2023-24.

Ms. _________
[PGT CS / IP]
ACKNOWLEDGEMENT
I would like to express my special thanks of gratitude to my
teacher Ms. __________ as well as our principal Mr. Sourabh
Kashyap who gave me the golden opportunity to do this
wonderful project on the topic “____________ MANAGEMENT
SYSTEM ”which also helped me in doing a lot of Research and
I came to know about so many new things I am really thankful
to them.
Secondly I would also like to thank my parents and friends who
helped me a lot in finalizing this project within the limitedtime
frame.

Your name
XII-______
SYSTEM SPECIFICATIONS

Hardware configuration:

a) Processor : Intel® Core


b) Memory : 8 GB RAM
c) System Type : 64 Bit

Software configuration:-

a) Operating system : Windows 7/10


b) Back end : MySQL files
c) Front end : Python
OBJECTIVE:
The project helps to manage all the data relates to
library in a very handy way. The main objective of the
Project of Library Management System is to manage
the details of users as well as books. The library
management system software makes the library a
smart one by organizing the books systematically and
to operate a library with efficiency and at reduced
costs. This enables users to search for books quickly
and effortlessly.

The program also works with:


 Add book
 Issue book
 Submit book
 Deleting of book
 Details of all books
DESCRIPTION:

The LIBRARY MANAGEMENT SYSTEM is basically a


database project done in python language and with the
help of MySQL connectivity.
This project is very useful for the librarians to keep a
count on the data tables, the books they have and how
much books they have issued and to whom and when
was it returned.

It handles the data of library in a tabular form. It also


add, create,delete,update the books.
Since the back end used is database, the data is stored
in MySQL file .The software will help in smooth
functioning of the data and will help reduce teachers’
load to a great extent.
SOURCE CODE
# LIBRARY MANAGEMENT SYSTEM PROJECT
import mysql.connector
print("\n--------------------------------------------------------------------------------")
print("\t\t\tVERIFICATION OF MYSQL CONNECTIVITY ")
print("--------------------------------------------------------------------------------")
# Establish connection with MySQL database
try:
db = mysql.connector.connect(
host="localhost",
user=input("\t\t Enter the username of MYSQL user: "),
password=input("\t\t Enter the password: "),
)
print("\t\t\t Connection successfully created")
except Exception:
print("There was an error connnecting to the database")

cursor = db.cursor()

# Create the library database and books,issue,submit table if it doesn't exist


cursor.execute("CREATE DATABASE IF NOT EXISTS library")
cursor.execute("use library;")

cursor.execute(
"CREATE TABLE IF NOT EXISTS books ( bname varchar(50), bcode varchar(10),no_of_books int,subject
varchar(50))"
)

cursor.execute(
"CREATE TABLE IF NOT EXISTS issue ( name varchar(50), regno varchar(10),bcode int,issue_date date)"
)

cursor.execute(
"CREATE TABLE IF NOT EXISTS submit ( name varchar(50), regno varchar(10),bcode int,submit_date date)"
)

# Function To Add A New Book.


def add_book():
try:
bname=input("Enter the book name=")
code=input("Enter the book code=")
no_of_books=int(input("Enter the book amount="))
sub=input("Enter the subject name=")
data=(bname,code,no_of_books,sub)

# Insert the new account into the accounts table


sql='insert into books values(%s,%s,%s,%s)'
cursor.execute(sql,data)
db.commit()
print("Book added successfully")
except Exception:
db.rollback()
print(
"An error has occurred. Please try again later or contact technical support for assistance."
)

# Function To Issue A Book


def issue_book():

bname=input("Enter the name=")


reg_no=input("Enter the registration no=")
code=input("Enter the book code=")
issue_date=input("Enter the date=")
data=(bname,reg_no,code,issue_date)
sql='insert into issue values(%s,%s,%s,%s)'
cursor.execute(sql,data)
print("###########################################")
print("Book issued to =",bname)
db.commit()
book_update(code,-1)

# Function To Update A Book


def book_update(code,u):

qr="select total from books where bcode=%s"


data=(code,)
cursor.execute(qr,data)
myres=cursor.fetchone()
t=myres[0]+u
q="update books set total=%s where bcode=%s"
d=(t,code)
cursor.execute(q,d)
db.commit()

# Function To Submit A Book


def submit_book():

bname=input("Enter the name=")


reg_no=input("Enter the registration no=")
code=input("Enter the book code=")
issue_date=input("Enter the submission date=")
data=(bname,reg_no,code,issue_date)
sql='insert into submit values(%s,%s,%s,%s)'
cursor.execute(sql,data)
print("###########################################")
print("Book submitted from =",bname)
db.commit()
book_update(code,1)
# Function To Delete A Book
def del_book():

code=input("Enter the book code=")


qu="delete from books where bcode=%s"
data=(code,)
cursor.execute(qu,data)
db.commit()
print("\t\tBook Deleted Successfully")

# Function To Display Books Of Library


def display_book():
qu="select * from books";
cursor.execute(qu)
myres=cursor.fetchall()
for i in myres:
print("\t\t\t Book Name:",i[0])
print("\t\t\t Book Code:",i[1])
print("\t\t\t Total No Of Books",i[2])
print("**************************************************************")

# LIBRARY MENU
while True:
print("\n*******************************************************************************")
print("\t\t\t\tWELCOME TO MY LIBRARY")
print("*******************************************************************************")
print("\n\t\t###############LIBRARY MAIN MENUE###############")
print("\t\t\t\t1:Add Book")
print("\t\t\t\t2:Issue Book")
print("\t\t\t\t3:Submit Book")
print("\t\t\t\t4:Delete Book")
print("\t\t\t\t5:Display Books")
print("\t\t\t\t6:Exit\n")
choice = input("Enter your choice (1-6): ")
if choice == "1":
add_book()
elif choice == "2":
issue_book()
elif choice == "3":
submit_book()
elif choice == "4":
del_book()
elif choice == "5":
display_book()
elif choice == "6":
print("Thank you for using our software. Have a nice day!")
break
else:
print("Invalid choice. Please enter a valid choice.")
MYSQL
SCREENSHOTS
SCREEN OUTPUT
CONCLUSION
The project entitled “LIBRARY MANAGEMENT SYSTEM” is developed
using Python as front end and MYSQL as back end to computerize the
process of data management . This project covers all basic functionality
required to work in library and also helps reduce the work load .

BIBLIOGRAPHY
Google Chrome
Sumita Arora - CS Textbook

You might also like