0% found this document useful (0 votes)
31 views17 pages

Shreya Singh Xii-B Cs Project

The document outlines a project titled 'Library Management System' completed by Shreya Singh at D.A.V. Centenary Public School, which aims to automate the manual library system using computer software. It details the project's purpose, hardware and software requirements, and includes Python code for various functionalities like adding, deleting, issuing, and returning books. The project emphasizes efficient data management, error reduction, and improved resource utilization within the library.

Uploaded by

Kavitha
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)
31 views17 pages

Shreya Singh Xii-B Cs Project

The document outlines a project titled 'Library Management System' completed by Shreya Singh at D.A.V. Centenary Public School, which aims to automate the manual library system using computer software. It details the project's purpose, hardware and software requirements, and includes Python code for various functionalities like adding, deleting, issuing, and returning books. The project emphasizes efficient data management, error reduction, and improved resource utilization within the library.

Uploaded by

Kavitha
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

D.A. V.

CEN TEN ARY PUB LIC SCH OOL

PAS CHI M ENC LAV E ~DE LHl- 110 087

CO M PU TE R
SC IE NC E
PR OJ EC T
BY: -
SHR EYA SIN GH

(X/1 -B)
MANAGEMENT

SYS~
This is to certify that the Project Work titled -
llBHAHYNANAGENENTSYSTEN'is a oona fide work
carriedout andsuccessfully completedJ,y Shreya Singh
ofclass %11-8 ofO.A. V. Centenary Puo/ic School, Delhi
untlerthe
guidance andsupervision ofNs. Sona/i Sareen.

TEACHER 6l/ lO E
Ma. SONAll SAREEN
First andforemost, I would like to express my sincere
g1·atitudefo1· the opportunity to work on this p1·oject.
It was indeed a valuable experience that allowed me to
develop my skills and knowledge in this.field.
The p1·oject not only helped me understand the concepts
taught in class but also provided me with a practical
application ofthose concepts in real-life scenarios.
I would also like to extend my thanks to my teache1· ,
Ms. Sonali Sareenfor guiding me throughout the
project andfor providing me with the necessary
resources and support.
Her expertise and guidance were instrumental in
helping me navigate th1·ough the complexities of the
project and ensuring it's successful completion.
I would also like to thank my pa1·en ts andfri.ends who
helped me in completing the project within the limited
timeframe.
The purpose of Library Management System is to automate the
existing manual system by the help of computerized equipments and
full-fledged computer software, fulfilling their requirements, so that
their valuable data/information can be stored for a longer period with
easy accessing and manipulation of the same. The required software
and hardware are easily available and easy to work with.

Ubrary Management System, as described above, can lead to error


free, secure, reliable and fast management system. It can assist the
user to concentrate on their other activities rather to concentrate on
the record keeping . Thus ,it will help the organization in better
utilization of resources. The organization can maintain computerized
records without redundant entries. That means one need not be
distracted by information that is not relevant, while being able to
reach the information.

The project will enable the Library Manager to view all the details of
the books stored. As per the requirements they may add a new book
to the records or delete an existing book from the records. They would
be able to maintain the details of clients who have issued books or
returned books. They will also be able to calculate fine in case of delay
of submission of books.
HARDWARE RE(ll/lREMENTS:-
► System : Pentium i3 Processor
► Hard Disk : 500 GB
► Monitor : 15" LED
► Input Devices : Keyword, Mouse
► RAM:4GB

SOFTWARE RE(IIJIREMENTS:-
•!•Operating System: WINDOWS 11
•!•Coding Language: PYTHON
•!• IDLE (Python 3.10 64-bit)
•!•SQL SERVER Version 8.0.30
•!•Python-MySQL interface

SQ
I SQL DAT ABA SE - II
nysql > Use LIBRARY;
Database changed
nysql> Show table s;
+-------------------+
I Table s_in_ librar y I
+----------------+
I books
I issued_books
I returned_books
+-- ---- ---- --+
3 rows in set (0.00 sec)

nysql> Desc Books;


+--------+-------------+--- --+----+-------+------+I
I Field I Type I Null I ~ey I Defau lt I Extra

+-----------+-------------+-----+-----+---------+-------+
I Book_code int NO PRI NULL
I Title varchar(QS) YES NULL
I Author varch ar(30 ) YES NULL
I Quan tity int YES NULL
+----------+---------+----+----+--------+-----+
Q rows in set (8.80 sec)

nysql> Desc Issued_books;


+-----------+------------+- ----+-----+--------+------+I
I Field I Type I Null I ~ey I Defau lt I Extra

+------------+-------------+-- ----+----+--------+------+
Nane NO
varch ar(28 ) PRI NULL
regno int NULL
Book_code int PRI NULL
lssue _date date NULL
+---------+----------+-----+-----+------+-----+
Q rows in set (8.08 sec)
,ysql> Desc Returned_boo,s;

I Field I Type I Hull I Hey I Default I Extra I


+·----+----+---+--+--+---+
I N~e I varchar(38) I IIO I PR! I IIULL
I regno I int I YES I I NULL
I Boo,_code I int I IIO I PR! I NULL
I Return.date I date I YES I I NULL
ij rows in set (9.99 sec)

ll)'Sql> Select• fro, Boo,s;

I Boo,_code I Title I Author I Quantity I


+·--+--------------+----+
!llij I Treasure Island I Robert Louis Stevenson I 5I
1353 I Dracula I Br~ Sto,er I 15 I
1785 I Hoby Die, I Herman Melville I 5I
2297 I Pride and Prejudice I Jane Austen I 28 I
2lllll I The Pilgrin' s Progress I John Bunyan I 15 I
2819 I David Copperfield I Charles Dic,en I 8I
q999 I The Return of the Hing I J. R.R. Tolkien I 5I
ijllJl7 I The Girl on the Train I Rus,in Bond I 28 I
6283 I AChrist.as Carol I Charles Dic,en I 12 I
9871 I Alice's Adventures in Wonderland I Lewis Caroll I 10 I
I PYTHON CODE - I
1 !lf C-: ~ rnysql . connector
def l ogin () :
print ("~IBRARY MANAGEMENT SYSTEM")
print ("~OGIN")
un=input ("Enter User name . ")
pw=input ("Enter Password . ")
... ! un=="LIB@7314 " an pw==":173141 ":
print ("ACCESS GRANTED")
main ()
el.. :
print ("WRONG USERNAME OR PASSWORC")
l ogin ()
1

~ -- f display () :
myd.b=mysql .connector .connect(host="l ocalhost", user="root ",
database= ":::i::BRARY", password="Nidhi@2007")
cursor=myd.b .cursor()
q="select * from books; 1
'

cursor .execute(q)
r=cursor . fetchall()
~ - i lt r :
print ("BOOK_CODE : , i[ 0] , end=" ")
11

print ("':'ITLE : , i[l], end="" )


11

print ("AUTHOR:", i[2] , end=" n)


print ("QUANTITY :", i[3) , end="\ n")
myd.b . close ()
I f delbook () :
mydb=mysql .connector .connect(host="localhost",user="root",
database=":iIBRARY",password="Nidhi@2007")
cursor=mydb .cursor()
cd=int (input ("Enter code of the book you want to delete ."))
q="delete frombooks where Book_code=%s;"
data=(cd,)
cursor.execute (q,data)
mydb .commit ()
mydb .close ()
print ("BOOK DE~ETED SUCCESSFULLY 11
)

.: addbook () :
11
mydb=mysql .connector.connectlhost="localhost",user="root ,

database="~IBRARY", password="ltdhi~i~ij1"J
cursor=mydb .cursor(J
11
bcd=int (input l"Ent9r book code, ))

ti=input ("Enter title of the book,")


au=input ("Enter nan:e of che author.")
qt=int (input l"Enter the quantity of books ," ))
q=":nsPrt into books(book_code,ti tle,author,quantityJvalues(ll , 1 \) 1, 1 II', ll) ",format(bcd,ti,au,qt)
cursor.executelql
mydb ,corrani t (l
mydb,close()
print ("BOOK ADDEDSUCCESSFULLY")
issuebook O:
mydb=mysql.connector.connect{host=•.~~albr,t',user="rG,~1 ,database="LIBRA.~Y•,passvord="Nijhi@2001")
cursor~mydb,cursor()
name=input i'Ente. no:£ .")
reg=int (input1•·n·er registration nm:ber."))
bocd=int (input('inter cod: of book :o t~ .•Juea."))
isd=input ('Ent~. :ate of issue.")
ql="select quantity from books where hoot_code=is;"
data= (bocd,)
cursor.execute(ql,data)
d=cursor.fetchalll)
d(O]= (0, l:
print ('BOCK !i~:' Av'JC:.~LE:")

q2="1ns0 rt 13t .•~ued_books(na::E,r~gw,book_code,1ssi::_iia:e)values( 1 ()' ,11,11, ' 11')".format(na:ne,reg,bocd,isd


cursor.execute (q2)
q3="up1ate c , -~~ quantity=qur.~ity-! '-here book_code=is;•
b= (bocd,J
cursor.execu~(ql,b)
mydb.comt o
print (' BO.' i•.r:.: SUCCESSFtr..~Y")
mvdb.close ll
- returnbook I) :
mydb=mysql .connector .connect (host=•:~cilllosc•,user="r t' ,database="LIBRAPi'",passvord="N1dhi@2tJ01'1
cursor=mydb,cursor II
name=inputl":r:=! ~a::.')
reg=int (input('tjt=! r~gistration n~r.'11
bocd=int (input ('~ce: cod: of boc\: ~o t: returned. "II
rtd=input ('Ent:r date uf return .' )
ql="insert u.~: rcturned_books(naJ::,r:gn~,ixlok_code,re:u!n_da~:)values( 1IJ ' 1 !J, li, ' 11 ')" ,format (naire,reg,bocd,rtd
cursor.execute(ql)
q2="update bo1:s ~;: r~antity=quan:i:y-1.~ere book_cod:-\s;•
a=(bocd, l
cursor .execute(q2,a)
q3="delete frc" 1° ~2:_books where n~=is and book_c0::=~s;•
0

b= (name,bocd)
cursor.execute(q3,b)
mydb.commit O
print ("BOOK ?.EJJFr:.D SUCCESSfl.11LY")
mydb.close II
jer fine () :
datetime .mport date
n= input ( "Enter name ." )
bc=int (input ("Enter code of the book borrowed ." ))
a=int (input (" Enter year of issue . " ))
b=int (input ("Enter month of issue ." ))
c=int (input ("Enter date of issue . " ))
d=int (input ("Enter year o:: return ." ))
e=int (input ("Enter month of return ." ))
f=int (input ("Enter date of return . " ))
dl =date(a , b , c)
d2=date(d, e ,f )
~~1 diff_dates (datel , date2) :
-~-~n abs (date2- da tel) . days
x=diff_dates(dl , d2)
_ x>7 :
fine=x*2
print (" FINE TO BE PAID : Rs . " , fine)
el 0
:

print {" SUBMISSION ON TIME . NO FINE . " )

d main <> :
print ( '' Press 1 to display details of all -hP books . '' )
print ( '' Piess 2 to add a new book . '' )
print ( '' Press 3 to dele~e an existing book . '' )
print ( " Piess 4 to issue a book . '' )
print ( "Press 5 to return a book ." )
print ( " Press 6 to view fine . '' )
print ( " Press 7 to exit" )
ch=int (input ( "Enter choi~e." ))
ch= 1 :
dis play()
E: • ch=2 :
addbook()
~~ ch=J :
delbook()
e,li ... ch=4 :
issuebook ()
e..._..L. ..... ch=S :
r eturnboo k ()
el.~ ch=6 :
f ine()
-==l-- ch=7 :

login ()
I OUTPUT- I
LIBRARY MANAGEMENT SYSTEM
LOGIN
Enter user name . Lib73l4
Enter Password . 7314
WRONG USERNAME OR PASSWORD
LIBRARY MANAGEMENT SYSTEM
LOGIN
Enter user name . LIB@7314
Enter Passw ord . #7 3 l4•
ACCESS GRANTED
Press l to display details of a l l the books .
Press 2 to add a new book .
Press 3 to delete an existing book .
Press 4 to issue a book .
Press 5 to return a book .
Press 6 to view fine .
Press 7 to exit

Enter choice.1
BOOK_CODE: 131~ TITLE: Treasure Island AUTHOR: Robert Louis Stevenson QUANTITY: 5
BOOK CODE: 1353 TITLE: Dracula AUTHOR: Bram Stoker QUANTITY: 15
BOOK_CODE: 1105 TITLE: Moby Dick AUTHOR: Herman Melville QUANTITY : 5
BOOK_CODE: 229, TITLE: Pride and Prejudice AUTHOR: Jane Austen QUANTITY: 20
BOOK_CODE: 2~~1 TITLE: The Pilgrim's Progress AUTHOR: John Bunyan QUANTITY: 15
BOOK_CODE: 2ij~9 TITLE: David Copperfield AUTHOR: Charles Dicken QUANTITY: ij
BOOK_CODE: ~090 TITLE: The Return of the King AUTHOR: J,R,R.Tolkien QUANTITY : 5
BOOK_CODE: ~~~, TITLE: The Girl on the Train AUTHOR: Ruskin Bond QUANTITY: 20
BOOK_CODE: 6203 TITLE: AChristmas Carol AUTHOR: Charles Dicken QUANTITY: 12
BOOK CODE: 9ij1l TITLE: Alice 's Adventures in Wonderland AUTHOR: Lewis Caroll QUANTITY: 11
-
Press 1 to display details of all the books .
Press 2 to add a new book .
Press 3 to delete an existing book .
Press 4 to issue a book .
Press 5 to return a book .
Press 6 to view fine .
Press 7 to exit
Enter choice . 2
Enter book code . 1234
Enter title of the book .Train to Mussoorie
Enter name of the author .Ruskin Bond
Enter the quantity of books . lo
BOOK ADDED SUCCESSFU~~y
Press 1 to display details of all the books .
Press 2 to add a new book.
Press 3 to delete an existing book.
Press 4 to issue a book.
Press 5 to return a book.
Press 6 to view fine .
Press 7 to exit
Enter choice.3
Enter code of the book you want to delete .1234
BOOK DELETED SUCCESSFULDY
Press 1 to display details of all the books .
Press 2 to add a new book .
Press 3 to delete an existing book .
Press 4 to issue a book.
Press 5 to return a book .
Press 6 to view fine .
Press 7 to exit
Ente·r choice . 4
Ent e,r name . Suni ta
Enter registration nurnber . 6789
Enter code of book to be issued . 4090
Enter date of issue . 2024-11-24
BOOK NOT AVAILABLE

Press 1 to display details of all the books .


Press 2 to add a new book .
Press 3 to delete an existing book .
Press 4 to issue a book .
Press 5 to return a book .
Press 6 to view fine .
Press 7 to exit
Enter choice .4
Enter name .Arnav
Enter registration nurnber .8796
Enter code of book to be issued .1314
Enter date of issue . 2024-12-01
BOOK ISSUED SUCCESSFULLY
Pre ss 1 t o dis pla y det ails of all the boo ks
Pre ss 2 to add a new boo k .
Pre ss 3 to del ete an exi stin g boo k .
Pre ss 4 to issu e a boo k .
Pre ss 5 to retu rn a boo k .
.
Pre ss 6 t o view fine .
Pre ss 7 t o exi t
Ent er cho ice . 5
Ent er name . Arn av
Ent er reg istr atio n num ber . 8796
Ent er cod e of boo k t o be retu rne d . 1314
Ent er dat e of retu rn . 202 4-1 2-1 2
BOOK RETURNED SUCCESSFULLY
Ent er c h oice . 6
Ent er nam e . Raj iv
Ente r cod e o f the boo k b or rowe d . 123 4
Ent er y ear o f issu e . 202 4
Ent er m o n th o f i ss ue . l 2
Ente r date of issu e . 12
Ent er yea r of retu rn . 202 4
Ent er m o nth o f retu rn . 12
Ent er date of retu rn. 28
FINE TO BE PAID : Rs . 32
Pre ss 1 to disp lay det ail s of a l l the b oo k s .
Pre ss 2 to add a n e w boo k .
Pres s 3 to del ete an e xi stin g boo k .
Pre ss 4 to issu e a boo k .
Pre ss 5 to retu rn a boo k .
Pre ss 6 to view fine .
Pre ss 7 to exi t
Ent er cho ice . 6
E nte r nam e. s uni l
Ent er cod e o f the b ook b orrow e d . 1 3 14
Ent er y e ar o f issu e . 202 4
Ent er m o nth or i ss u e . 12
Ent er date of i ssu e . 1 3
Ente r yea r of retu rn . 202 4
Ent er mon th o f retu r n . l 2
Ent er date of retu rn . 1 9
SUBM I SSION ON TIM E .NO F INE .
For the successful completion of the
project I have taken help from the
following websites:-

• www.wikipedia.com
• www.slideshare.com
• www.scribd.com
• www.googJeimages.com
• www.routube.com

You might also like