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

Digital-Library.docx (1) (1) (1)

Digi Library project

Uploaded by

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

Digital-Library.docx (1) (1) (1)

Digi Library project

Uploaded by

minim.me2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 26

SALTLAKE SHIKSHA NIKETAN

COMPUTER SCIENCE PROJECT


2024-25
PROJECT TOPIC:
LIBRARY MANAGEMENT SYSTEM
Submitted by:
Name: SOUVIK DEY
Class: XII-C

CBSE Roll Number:


Under the Guidance of:
HARDWARE AND SOFTWARE
REQUIRED

HARDWARE:
1. Desktop Computer / Laptop
2. Mobile Phone

SOFTWARE:
1. Python (Latest Version)
2. MySQL
3. MySQL-Connector-Python,Requests,Wikipedia-API ,
Datetime, Pyfiglet Modules
TABLE OF CONTENTS

Topi
S.No. c Page No.

1 Certificate 1
2 Acknowledgement 2
Hardwares and Softwares
3 3
Required
4 Introduction 5

5 Python Source Code 10


6 MySQL Database
7 Outputs
8 References
INTRODUCTION
The project LIBRARY MANAGEMENT SYSTEM (DIGITAL
LIBRARY) includes enrolment of users, adding of books into
the library system. It includes an authentication facility for
admin and user to login into the admin panel and user
panel resp. of the system. User can see the books available,
details of books issued by the user in the digital library. The
Library Management System can be login using a user ID
and password. It is accessible either by an admin or user.
Only the admin can add, delete and update the data of
users and books into the database. The data can be
retrieved easily. The interface is very user-friendly. The data
is well protected for personal use and makes the data
processing very fast. The purpose of the project entitled as
“DIGITAL LIBRARY” is to computerize the Front Library
Management to develop software which is user friendly,
simple, fast, and cost-effective.
LIBRARY
A library is a collection of books, and possibly other
materials and media, that is accessible for use by its
members and members of allied institutions. Libraries
provide physical or digital materials, and may be a physical
location, a virtual space, or both. A library's collection
normally includes printed materials which may be
borrowed, and usually also includes a reference section of
publications which may only be utilized inside the premises.
Libraries can vary widely in size and may be organised and
maintained by a public body such as a government, an
institution (such as a school or museum), a corporation, or a
private individual. In addition to providing materials,
libraries also provide the services of librarians who are
trained experts in finding, selecting, circulating and
organising information while interpreting information
needs and navigating and analysing large amounts of
information with a variety of resources.
LIBRARY MANAGEMENT
SYSTEM (DIGITAL LIBRARY)
Library management system (LMS), is an enterprise
resource planning system for a library, used to track
enrolled users, available books, books issued and to whom,
books returned and its fines, etc.
The purpose of a library management system is to operate a
library with efficiency and at reduced costs. The system
being entirely automated streamlines all the tasks involved
in operations of the library.
The library management system software helps in reducing
operational costs. Managing a library manually is labour
intensive and an immense amount of paperwork is involved.
The system saves time for both the user and the librarian.
With just a click the user can search for the books available
in the library. The librarian can answer queries with ease
regarding the availability of books. Adding, removing or
editing the database is a simple process. Adding new users
or cancelling existing user memberships can be done with
ease. The automated system saves a considerable amount of
time as opposed to the manual system.
FUNCTIONS LIST

❖ Admin
Login into User
Panel Modify User
● Add User
● Delete User
● Update User Display Users Search Users Modify
Book
● Add Book
● Delete Book
● Update Book Issue Book Return Book Change
Admin Home
Back
Exit
❖ User
About Library
News
Wikipedia Articles
Display Books
Search Books
Issued Books Details
Home
Back
Exit
Python
Source Code
import mysql.connector
db1 = None
def connect():
global db1
db1 = mysql.connector.connect(host="localhost",user="root",
password="mypass",
database = "library"
)

def showMembers():
c1 = db1.cursor()
c1.execute("select * from member")
res = c1.fetchall()
print("-"*40)
print("List of Members ")
print("-"*40)
for val in res:
print(val[0] + "\t" + val[1] +"\t"+val[2]+"\t"+val[3])
print("-"*40)

def login():
print("-" * 40)
print("\t Digital Library Management System")
print("-" * 40)
print("\t LOGIN")
un = input("Enter User Name : ")
pw = input("Enter Password : ")
q = "select * from users where username = %s and passw =
%s" val = (un,pw)
c2 = db1.cursor()
c2.execute(q,val)
res = c2.fetchall()
print("-" * 50)
if len(res) == 0:
print("Invalid User Name or Password ")
print("-" * 50)
return False
else:
print("Access Granted !!!")
print("-" * 50)
return True

def delMember():
print("-" * 40)
print("\tDELETING A MEMBER")
print("-" * 40)
mid = input("Enter Member Id : ")
cursor1 = db1.cursor()
q = "delete from member where mid=" + mid
cursor1.execute(q)
db1.commit()
print("Member Deleted Successfully")
def addMember():
print("-" * 50)
print("\t ADDING A NEW MEMBER")
print("-" * 50)
mid = input("Enter Member Id : ")
name = input("Enter Member Name : ")
phone = input("Enter Phone Number : ")
email = input("Enter Email :")

cursor1 = db1.cursor()
q = "insert into member values (%s,%s,%s,%s)"
val = (mid,name,phone,email)
cursor1.execute(q,val)
db1.commit()
print("Member Added Successfully")

def showMembers():
cursor1 = db1.cursor()
cursor1.execute("Select * from Member")
res = cursor1.fetchall()
print("-" * 50)
print(" MEMBER DETAILS ")
print("-" * 50)
print("Id Name Email Phone ")
for k in res:
print(k[0]," ",k[1]," ",k[2]," ",k[3])

def delBook():
print("-" * 40)
print("\tDELETING A BOOK")
print("-" * 40)
bid = input("Enter Book Id : ")
cursor1 = db1.cursor()
q = "delete from book where bookid=" + bid
cursor1.execute(q)
db1.commit()
print("Book Deleted Successfully")

def addBook():
print("-" * 50)
print("\t ADDING A NEW BOOK")
print("-" * 50)
bid = input("Enter Book Id : ")
title = input("Enter Book Title : ")
author = input("Enter Author name : ")
pub = input("Enter Publisher :")
cost = int(input("Enter Cost of the book :"))

cursor1 = db1.cursor()
q = "insert into book values (%s,%s,%s,%s,%s)"
val = (bid,title,author,pub,cost)
cursor1.execute(q,val)
db1.commit()
print("Book Added Successfully")
def showBooks():

cursor1 = db1.cursor()

cursor1.execute("Select * from Book")


res = cursor1.fetchall()
print("-" * 50)

print(" BOOK DETAILS ")


print("-" * 50)

print("Id Title Author Publisher Cost ")


for k in res:

print(k[0], " ",k[1]," ",k[2]," ",k[3]," \t",k[4])

def showIssued():
cursor1 = db1.cursor()
cursor1.execute("Select * from issue")
res = cursor1.fetchall()
print(" LIST OF ISSUED BOOKS ")
print("-" * 40)
print("Member Bookid Issue Date")
for k in res:
print(k[0],"\t",k[1],"\t",k[2])
print("-" * 40)

def showReturned():
cursor1 = db1.cursor()
cursor1.execute("Select * from issuelog")
res = cursor1.fetchall()
print(" LIST OF RETURNED BOOKS ")
print("-" * 50)
print("Member Book Id Issue Date Return Date")
for k in res:
print(k[0],"\t",k[1],"\t",k[2],"\t",k[3])
print("-" * 50)
def issueBook():
bid = input("Enter the book id to be issued : ")
q ="select * from issue where bookid='" + bid +"'"
cursor1 = db1.cursor()
cursor1.execute(q)
res = cursor1.fetchall()
if len(res)== 0:
mid = input("Enter the member id : ")
doi = input("Enter the date of issue in 'YYYY-MM-DD' format : ") #
date format is 'YYYY-MM-DD'
q = "insert into issue (mid,bookid,dateofissue) values(%s,%s,%s)"
data = (mid,bid,doi)
cursor1.execute(q,data)
db1.commit()
print("-" * 40)
print(" Book Issued Successfully")
print("-" * 40)

else:
print("-" * 40)
print(" Sorry ! The Book is not available")
print("-" * 40)

def returnBook():
bid = input("Enter the book id to be returned : ")
mid = input("Enter the Member id : ")
q ="select dateofissue from issue where bookid='" + bid +"' and mid='" +
mid +"'"
cursor1 = db1.cursor()
cursor1.execute(q)
res = cursor1.fetchall()
if len(res)== 0:
print("-" * 40)
print("This Book is not Issued to This Member ")
print("-" * 40)
else:
dort = input("Enter the date of return in 'YYYY-MM-DD' format : ")
q = "delete from issue where bookid='" + bid + "' and mid='" + mid + "'"
cursor1.execute(q)
db1.commit()
q = "insert into issuelog values(%s,%s,%s,%s)"
data = (mid,bid,res[0][0],dort)
cursor1.execute(q,data)
db1.commit()
print("Book Returned !!!")

connect()
print("Connected")
if login():
while True:
print("-" * 50)
print("\t CHOOSE AN OPERATION ")
print("-" * 50)
print("Press 1 - Add a New Member")
print("Press 2 - Delete an Existing Member")
print("Press 3 - Show all Members")
print("Press 4 - Add a New Book")
print("Press 5 - Delete an Existing Book")
print("Press 6 - Show all Books")
print("Press 7 - Issue a Book")
print("Press 8 - Return a Book")
print("Press 9 - Show Issued Books")
print("Press 10 - Show Returned Books")
print("Press 11 - Quit")
ch = int(input("Enter Your Choice : "))
if ch == 1:
addMember()
elif ch == 2:
delMember()
elif ch == 3:
showMembers()
elif ch == 4:
addBook()
elif ch == 5:
delBook()
elif ch == 6:
showBooks()
elif ch == 7:
issueBook()
elif ch == 8:
returnBook()
elif ch == 9:
showIssued()
elif ch == 10:
showReturned()
elif ch == 11:
break
MySQL
Database
Library Database:

Books Table:

Users Table:
Members Table:

Issued Books Details Table:


Outputs
Admin Authentication:

Adding a new user:


Adding a new book:

Issue a book:

Return of book:
Issued Books Details:

Deleting a book:
REFERENCES

1. Python https://www.python.org
/
2. MySQL https://www.mysql.com/

3. Class 11th & 12th Computer Science NCERT Books

You might also like