Library Management

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Comput

erSci
encePr
ojectFi
l
e

By:
Rudr
akaul
andAnushChol
kar

XI
I-
A
Boar
d’sRol
lno.
:14647468(Rudr
a)
14647448(
Anush)

Kendr
iyaVi
dyal
ayaDwar
kaSect
or-
12
Li
brar
yManagementSy
stem
KENDRI
YAVI
DYALAYADWARKASECTOR-
12
Submi
tt
edto-Mr
sManpreet
Submi
tt
edby-Rudr
aKaulandAnushChol
kar

CERTI
FICATE

Thi
sist
ocer
ti
fyt
hatRudr
aan
dAn
ushofcl
assXI
I-Aofkendr
iya
Vi
dyal
ayadwar
kasect
or-
12hasdonehi
spr
ojectonLI
BRARY
MANAGEMENTSYSTEM undermysuper
visi
on.
Hehast
aken
i
nter
estandhasshownatmostsi
ncer
it
yincompl
eti
onoft
his
project
.Icert
ifyt
hispr
ojectuptomyex pect
ati
on&asper
guidel
inesissuedbyCBSE, NEW DELHI
.
ACKNOWLEDGEMENT
I
tiswi t
hpl easur ethatI acknowl edgemys inceregr at
it
udet oour
t
ea cher,
Mr s .Ma npr eetwhot a ughta ndunde rtookt her esponsibi
li
ty
oft eachingthes ubj ectComput erScienc e.
I ha vebe engr eatl
ybe nefi
tedf rom he rc l
as ses.
Iam, es peciall
yindebtedt oourPr incipalMr .SalilSaxena
whoha sa lway sbe enas our ceofe nc our ageme nta nd
support
andwithoutwhos einspir
ationt hispr oj
e ctwoul dnotha vebe en
successful Iwoul dl i
ketopl ac eonr ec ordhe artf
e l
tt hankst ohim.
NowI woul dl iketoe xpressmys incerea pprec i
ationf oralltheother
s t
ude ntsformyba tchthe irfri
ends hip
&thef inet i
me stha twea l
l sharedt oge ther.
Har
dwar
eandSof
twar
eRe
qui
reme
n t
s
Descr
ipt
ion
Booksar
eimportantpartofli
fe,whetherwea rest
ude nt
sor
Grownup,
weneverstopslearni
ng.
Alibr
aryisaplacethatcomes
tomindwheneverwea reinmoodt odr i
veint
ot heuniver
seof
knowledge.

Thissimplepythonprojecti
sa nimpleme ntat
ionofas ystemto
ma nageali
brary,i
tsbook s.
Itisi
mpleme ntedbyus i
ngpy t
hon
ProgramminglanguageandMy SQLdatabasetheprogram r
unsi
n
anyc omputerthatsupportspythoninter
preterandMy SQL
Serverinst
all
ati
on
Obj
ect
ivesOfThePr
oject
Her
ear
ethepr
imeobj
ect
ivesoft
hispr
oject

•Useacomput
ert
ohandl
eal
lki
ndsofl
i
brar
y.
•I
mpl
emental
i
brar
ymanagementsof
twar
ewhi
chi
ssmal
lyetpower
ful
.
•UseMy
SQLdat
abasesf
orwor
kingwi
thl
i
brar
ydat
a.
•1.Keepi
ngr
ecor
dsofbook.
•2.Keepi
ngr
ecor
dsofi
ssueandr
etur
nbooks.
•3.Easi
l
ydel
etebooks.
Pr
opos
eds
yst
em
Thepr oposeds ystem will
beac ons olebas ed( CUI: Characteruseri
nterf
ace)
me nudr ivenpy thonprogr amt ha tus esMy SQLda t
a basest ost
orethe
differ
entse tofda tar elat
e dt oalibraryand
ca nruni na l
lcomput ersa ndla pt
ops .We ’
ll i
mple me ntthes yst
em us i
ng
foll
owi ngc ompone nts:
>book .py:i
twi l
lde fi
nethes tructureofabookna me ,
bookc ode,
totalno.of
book s,nameofs ub.
>issue .
py: i
twil
l defi
neswha tinfoi srecor de dwhe nabooki sissuedtoa
me mbe rs ucha sbookc ode ,issueda te,r
e gionalnumbe r,bookreciever
’s
na me .
>submi t
.py:itwil
l defi
neswha tinfoi srecor de dwhe nabooki ssubmi t
ted
by
theme mbe r.
>mai
n.py:
itwi
l
lbet
hest
art
ingpoi
ntofexecut
ionofasof
twar
e
i
mpor tmy sql.c onnec torasa
con=a. c onnec t(hos t='localhost
',
us er
='r
oot'
,passwd='
t
iger
'
,dat
abase='
Li
brar
y1'
)
#func tiont oaddabook
defaddbook (
):
book name=i nput (
'ENTERBOOKNAME: '
)
cd=i nt (
input ('EnterBOOKCODE: ')
)
tbook s=int(input ('
Ent erTOTALBOOKS: '
))
s=input ('
Ent erSubj ectName: '
)
dat a=( book name, c d,t
book s,
s )
a='ins ertintobook sv alues(%s ,
%s ,
%s,%s)'
c=c on. curs or( )
c.ex ec ute(a,dat a)
con. c ommi t()
print('Dat aEnt eredSuc cessful
ly!!
'
)
mai n( )

#func tiont oi ssue


bookdefi ss uebook (
):
name=i nput ('
Ent erNAME: '
)
reg=i nput ('
Ent erREGI ONALNUMBER: '
)
cd=i nt (i
nput ('
Ent erBOOKCODE: '
))
dat e=i nput ('Ent erDATE: '
)
dat a=( name, r
eg, cd,
dat e)
a='ins erti ntoi s suev alues (
%s ,
%s,%s,
%s )
'
c=c on. cur s or()
c.ex ec ute( a,dat a)
con. c ommi t()
print( '
Booki ssuedt o: '
,name)
book up( c d,-1)
#func tiont os ubmi ta
bookdefs ubmi tbook ():
n=input ('
Ent erNAME: '
)
r=input (
'Ent erREGI ONALNUMBER: '
)
cd=i nt (i
nput ('
Ent erBOOKCODE: '
))
d=input ('Ent erdat e:'
)
a='ins erti ntos ubmi tv alues(%s,
%s ,
%s,%s)'
dat a=( n,r,cd,d)
c=c on. cur s or()
c.ex ec ute( a,dat a)
con. c ommi t()
print( '
BOOKSUBMI TTEDFROM' ,
n)
book up( c d,1)
defbook up( cd,u) :
a='s elec tt otal from book swher e
bc ode=%s 'dat a=(cd,)
c=c on. cur s or()
c.ex ec ute( a,dat a)
my res ul
t=c .
fetc hone( )
t=my res ult[0]+u
sql=' updat ebook ssett otal=%swher ebcode=%s'
d=( t,
c d)
c.ex ec ute( sql,d)
con. c ommi t()
mai n( )
#func tiont odel eteabook
defdboo k ():
ac =input ('
Ent erBOOKCODE: ')a='
del
ete
f rom book swher ebc ode=%s 'dat
a=(
ac,)
c =c on. cur sor( )
c .e xec ut e(a,data)
c on. commi t()
mai n()
#func tiont odi splay
book sdefdi spbook ():
a=' sel ect*f rom
book s ' c=c on. cursor()
c.ex ec ute(a)
my res ult=c .fetc hall
()
fori i
nmy result:
pr i
nt (BOOKNAME:
' ',
i
[0])
pr int(BOOOCODE:
' '
,i
[1])
pr int (
'TOTAL: '
,i
[2])
pr int (
'SUBJECT: '
,
i[
3])
mai n( )
defmai n( )
:
pr i
nt (''
'
LIBRARYMANAGER
1. AddBook
2. I
s suebook
3. Submi tBook
4. Del et eBook
5. Dis playBook s
''
')
c hoi ce =int (
input ("ENTERTASKNUMBER: "
))i
f
c hoi c e==1 :
addbook ()
e li
fc hoi c e==2:
i
s s uebook ()
e li
fc hoi ce==3:
submi tbook ()
el i
fc hoi ce==4:
dbook ()
el i
fc hoi ce==5:
dis pbook )
(
el se:
print ("
wr ongc hoice")
mai n()
defps wd( ):
ps =input ('
Ent erpas s word:'
)
i
fps ==' tiger '
:
mai n()
els e:
pr i
nt ('
wr ongpas swor d'
)
ps wd( )
ps wd( )
OUTPUT
#ADDBOOK
#I
SSUEBOOK

#SUBMI
TBOOK
#DI
SPLAYBOOK

#DELETEBOOK
BI
BLI
OGRAPHY

•ComputerSci
encewi
thPy
thonby
Preet
iAror
a
•Cl
assNot
es
•Apni
Kaksha
•googl
e

You might also like