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

Library Project CS Stuti

Uwhwgw
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)
21 views

Library Project CS Stuti

Uwhwgw
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/ 21

LIBRARY MANAGEMENT

SYSTEM
Version 1.0 (2023-2024)

Computer Science (083) Project

Developed By

STUTI KATHURIA and VIKRAM RAJAK


XII U and XII T

Delhi Public School, R.K.Puram, New Delhi


www.dpsrkp.net

Project: Library Management System Page:#1/21


Index

Sno Description Pageno


1 Certificate 3
2 Acknowledgement & References 4
3 Introduction 5
4 Source Code 7
5 Output Screen 13
6 Hardware & Software requirement 19

Project: Library Management System Page:#2/21


Certificate
This is to certify that the Library Management
Computer Science project is developed by Stuti
Kathuria under my supervision in the session 2023-
2024.

The work done by them is original.

Anjana Virmani
Computer Science Teacher
Date: 22-12-2023

Project: Library Management System Page:#3/21


Acknowledgement
I would like to express my sincere gratitude to my
computer teacher Ms. Anjana Virmani for her vital
support, guidance and encouragement without which this
project would not come forth from my side. She helped
me complete the project by giving ideas, thoughts and
made this project easy and accurate.
I wish to thank my parents for their undivided support
and interest who inspired me and encouraged me,
without which I would not have completed my project
efficiently.

Reference

1.Classnotes
2.Google

Project: Library Management System Page:#4/21


Project Synopsis
Introduction
● This project is all about software for the library management system. It helps to have a
full-fledged control over library members.

● It receives username and password to login and register. It keeps the record of user
email, user phone number, user’s date of joining, books issued by the user.

AIM
● The objective of this project is to let us apply programming knowledge into a real- world
situation/problem and expose how programming skills help in developing a good
software.

Idea Source
● Today one cannot afford to rely on the fallible human beings who really want to stand
against today’s merciless competition where not too wise saying “to err is human” is
no longer valid, it’s outdated to rationalize your mistake. In order to keep up with the
times, we must incorporate programming into our daily lives in order to store data in a
more organized manner.
● Software has been and will continue to be a vital aspect of data management. Many
software products working are now in markets, which have helped in making the
organizations work easier and efficiently. Data management initially had to maintain a
lot of ledgers and a lot of paperwork had to be done but now software products in this
organization have made their work faster and easier. Now only this software has to be
loaded on the computer and work can be done.

Plan For Implementation


Type of Data: Binary File
Data Items Type of Data Description

1 Account ID integer To add customer ID

2 Name string Name of the customer

3 Email string Email of the customer

4 Phone Number int Phone number of the customer

5 Date Of Joining datetime.date Enters the date when customer joins

6 Date Of Issuing datetime.date Enters the date when customer issues a


book

7 Book Issued string Book Issued by the customer

Project: Library Management System Page:#5/21


Menu Options:
Main Menu Sub Menu

Menu

Creation of account

View account details

Display the books available

Add a book

Search book

View all the books by an author

Issue book

Return book

Validation and Add on Features


● In case the user enters any wrong input, we will ask them to retry. The coding will be
user friendly and the users will find everything comfortable. We have some special
things for some people which will be described properly in the coding.

Project: Library Management System Page:#6/21


Source Code
# Project Title : Library Management System
# Version : 1.0 2023-2024
# Developed By : Stuti Kathuria
# Guide : Anjana Virmani
# Last Updated On: 2023-12-22

import pickle
import getpass
from datetime import date
from tabulate import tabulate

# User Defined Functions/Methods


def AddUser():
R=[]
fees=0
with open("user.dat", "wb") as f:
name=input("Enter Name: ")
email=input("Enter Email: ")
phno=input("Enter Phone Number :")
while not len(phno) == 10 and phno.isnumeric():
print('Phone No. Should Have 10 Digits!')
phno= input('Enter Phone Number :')
while True:
password = getpass.getpass('Choose Password :')
conf = getpass.getpass('Confirm Password :')
if password==conf:
break
else:
print("Passwords Don't Match. Re-Enter.")
R.append([name,email,phno,password,10001,fees,dateofjoining])
print("Welcome to Kitaab Library Store", name, "!","\n"+"Your account is
registered as ACC NO", 10001,"\n")
pickle.dump(R,f)

c=10001
def AddItems():
try:
with open("user.dat","rb+") as F:
fees=0
R=pickle.load(F)
name=input("Enter Name: ")
email=input("Enter Email: ")
phno=input("Enter Phone Number :")
while not len(phno) == 10 and phno.isnumeric():

Project: Library Management System Page:#7/21


print('Phone No. Should Have 10 Digits!')
phno= input('Enter Phone Number :')
while True:
password = getpass.getpass('Choose Password :')
conf = getpass.getpass('Confirm Password :')
if password==conf:
break
else:
print("Passwords Don't Match. Re-Enter.")
global c
c+=1
R.append([name,email,phno,password,c,fees,dateofjoining])
print("Welcome to Kitaab Library Store", name, "!","\n"+"Your account is
registered as ACC NO", c,"\n")
F.seek(0)
pickle.dump(R,F)
except:
AddUser()

def BooksMenuDisplay():
with open ("bookdata.dat", "rb") as f:
R=pickle.load(f)
print(R)
head = ["Book Name", "Author"]
print( "B O O K S A V A I L A B L E \n")
print(tabulate(R, headers=head, tablefmt="grid"))
print("\n")

def AddBook():
with open ("bookdata.dat", "rb+") as f:
R=pickle.load(f)
add=input("Enter the name of the book you wish to add: ")
auth=input("Enter the name of the author: ")
R.append([add,auth])
global BandA
BandA.append([add,auth])
f.seek(0)
pickle.dump(R,f)
print("BOOK SUCCESFFULY ADDED!!!!!\n")

def Search():
with open ("bookdata.dat","rb") as f:
I=[]
R=pickle.load(f)
r= int(input("Do you wish to search book by \n1. Name\n2. Author\n"))

Project: Library Management System Page:#8/21


if r==1:
bookname= input("Enter Book Name: ")
for i in R:
if i[0]==bookname:
print("Book is available\n")
I.append(i[0])
if bookname not in I:
print("Book not found\n")

elif r==2:
bookauthor= input("Enter Book Author")
for i in R:
if i[1]==bookauthor:
print("Book is available\n")
I.append(i[1])
if bookauthor not in I:
print("Book not found\n")

def AuthorBooks():
with open ("bookdata.dat", "rb+") as f:
R=pickle.load(f)
author=input("Enter the name of the author: ")
I=[]
for i in R:
if author==i[1]:
I.append(i[0])

for i in range(len(I)):
print("Book", i+1, "by", author, ":", I[i])
if len(I)==0:
print("No books available by", author,"\n")

def ViewAcc():
with open("user.dat", "rb+") as f:
with open ("booksissued.dat","rb")as q:
Q=pickle.load(q)
R=pickle.load(f)
I=[]
acc=input("Enter acc no: ")
password=input("Enter password: ")
for i in R:
if password==i[3] or acc==i[4]:
I.append(i[3])
I.append(i[4])

Project: Library Management System Page:#9/21


print("A C C O U N T D E T A I L S")
print("NAME: ", i[0])
print("EMAIL: ", i[1])
print("PHONE NO: ", i[2])
print("DATE OF JOINING: ", i[6])
for i in Q:
if acc==i[0]:
print("Book issued: ",i[1],"\n")
if password not in I:
print("TRY AGAIN\n")

def IssueBook():
print("BOOKS AVAILABLE\n")
for i in range(len(OnlyBooks)):
print(i+1, OnlyBooks[i])
with open("user.dat", "rb+") as f:
with open("booksissued.dat","wb") as q:
I=[]
R=pickle.load(f)
acc=input("Enter acc no: ")
password=input("Enter password: ")
a=int(input("Select the book you wish to issue: "))
for i in R:
if password==i[3] or acc==i[4]:
print("Book Issued succesfully!!!! ")
print("DATE OF ISSUE: ", today,"\n")
I.append([acc,OnlyBooks[a-1],today])
q.seek(0)
pickle.dump(I,q)

def ReturnBook():
with open("user.dat", "rb+") as f:
with open ("booksissued.dat","rb+")as q:
Q=pickle.load(q)
R=pickle.load(f)
I=[]
acc=input("Enter acc no: ")
password=input("Enter password: ")
for i in R:
if password==i[3] or acc==i[4]:
I.append(i[3])
I.append(i[4])
for i in Q:
if acc==i[0]:

Project: Library Management System Page:#10/21


print("Book issued: ",i[1])
print("RETURNING",i[1])
r=input("PRESS Y TO CONFIRM: ")
if r=="Y":
Q.clear()
print("BOOK RETURNED")
q.seek(0)
pickle.dump(Q,q)

if password not in I:
print("TRY AGAIN\n")

# Main Code
dateofjoining = date.today() #dateofjoining
today=date.today() #dateofissuingbook
OnlyBooks=['The Dutch House', 'The Silent Patient', 'The Testaments', 'Normal
People', 'City of Girls', 'The Water Dancer', 'Daisy Jones and The Six', 'Yes',
'The Institute', 'The Book Women of Troublesome Creek', 'Maybe You Should Talk
To Someone', 'Talking To Strangers', 'Say Nothing', 'Know My Name', 'The Yellow
House', 'Three Women', 'How To Do Nothing', 'Trick Mirror', 'A Woman of No
Importance', 'American Royals', 'A Curse So Dark and Lonely', 'The Wicked
King', 'Two Can Keep a Secret', 'Sorcery of Thorns', 'The Lovely War', 'House
of Salt and Sorrows', 'Wilder Girls', 'Wayward Son']
BandA=[['The Dutch House', 'Ann Patchett'], ['The Silent Patient', 'Alex
Michaelides'], ['The Testaments', 'Margaret Atwood'], ['Normal People', 'Sally
Rooney'], ['City of Girls', 'Elizabeth Gilbert'], ['The Water Dancer', 'Ta-
Nehisi Coates'], ['Daisy Jones and The Six', 'Taylor Jenkins Reid'], ['Yes',
'Mary Beth Keane'], ['The Institute', 'Stephen King'], ['The Book Women of
Troublesome Creek', 'Kim Michele Richardson'], ['Maybe You Should Talk To
Someone', 'Lori Gottlieb'], ['Talking To Strangers', 'Malcolm Gladwell'], ['Say
Nothing', 'Patrick Radden Keefe'], ['Know My Name', 'Chanel Miller'], ['The
Yellow House', 'Sarah M. Broom'], ['Three Women', 'Lisa Taddeo'], ['How To Do
Nothing', 'Jenny Odell'], ['Trick Mirror', 'Jia Tolentino'], ['A Woman of No
Importance', 'Sonia Purnell'], ['American Royals', 'Katharine McGee'], ['A
Curse So Dark and Lonely', 'Brigid Kemmerer'], ['The Wicked King', 'Holly
Black'], ['Two Can Keep a Secret', 'Karen M. McManus'], ['Sorcery of Thorns',
'Margaret Rogerson'], ['The Lovely War', 'Julie Berry'], ['House of Salt and
Sorrows', 'Erin A. Craig'], ['Wilder Girls', 'Rory Power'], ['Wayward Son',
'Rainbow Rowell']]
with open ("bookdata.dat","wb") as f:
pickle.dump(BandA,f) #adds books and author names to the database
print(" "*80, "WELCOME TO KITAAB LIBRARY"," " *80)
print("\nRULES AND REGULATIONS\n")
print("1. Only one book can be issued at a time\n2. Maintain decorum at all
times\n3. If you wish to add a book, simply write the name and the author of

Project: Library Management System Page:#11/21


the book\n4. Keep your passwords protected\n5. Do not forget to log out before
leaving\n")
print(" "*73,"HOPE YOU HAVE A GOOD EXPERIENCE BOOKWORM!"," "*80)

while True:
r=int(input("1: CREATE ACCOUNT\n2: VIEW ACCOUNT DETAILS\n3: DISPLAY BOOKS
AVAILABLE\n4: ADD BOOK\n5: SEARCH FOR BOOK\n6: VIEW ALL BOOKS BY AN AUTHOR\n7:
ISSUE A BOOK:\n8: RETURN BOOK\n0: QUIT "))
if r==1:
AddItems()
elif r==2:
ViewAcc()
elif r==3:
BooksMenuDisplay()
elif r==4:
AddBook()
elif r==5:
Search()
elif r==6:
AuthorBooks()
elif r==7:
IssueBook()
elif r==8:
ReturnBook()
elif r==0:
break

Output Screen
(All Operations)

Project: Library Management System Page:#12/21


Introduction

Operation 1(Create Id)

Project: Library Management System Page:#13/21


Operation 2(View Account Details)

Operation 3 (Display
all books available)

Project: Library Management System Page:#14/21


Operation 4 (Add Book)

Project: Library Management System Page:#15/21


Operation 5 (Search for a book)

Project: Library Management System Page:#16/21


Operation 6 (Search for all the books by an author)

Project: Library Management System Page:#17/21


Operation 7 (Issue a book)

Project: Library Management System Page:#18/21


Execution of operation 7

Project: Library Management System Page:#19/21


Operation 8 (Return a book)

Hardware & Software Requirement

Project: Library Management System Page:#20/21


Hardware Requirement
PC/Laptop/MacBook with
Intel core/i3/i5/i7 or any equivalent
With at least 2 GB RAM
10 MB free space on Hard Disk
LCD/LED

Operating System &


Compiler
MS Windows/Ubuntu/MacOS

Python IDLE 3.x


OR
colab.research.google.com (gmail account)

and/or
MySQL 8.x

Project: Library Management System Page:#21/21

You might also like