Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

Informatics Practices Project 2020 – 2021

Kendriya Vidyalaya Sector 5 Dwarka New


Delhi- 110075.

Topic
Book store management

Submitted To: Submitted By:


Mrs. Chandrakiran Dhruv Dabass
Satdeve Himanshu Yadav
CERTIFICATE

This is Certify that “Dhruv Dabass”


student of class 12th “C” has successfully
completed There Informatics Practices
project on “Book Store Management”
under the guidance of “Mrs.
Chandrakiran Satdeve Mam”.
ACKNOWLEDGEMENT

We world like to express our special


thanks to our teacher “Mrs.
Chandrakiran Satdeve” Mam, who gave
us this wonderful project. This project
helped us in doing a lot of research and
we came to know about a lot of new
things about this project.
PROGRAM

import pandas as pd

import matplotlib.pyplot as plt

x={"BOOK_id":[1,2,3,4,5],

"bookName":["The art war", "Poke the box", "Life boat", "The guide", "Dark life"],

"publisher name":["pengium","pengium","Simon","pengium","DHANPAT RAI"],

"Author name":["Sun tzu","Sethgodin","Elizabeth kaye","RK Narayan","Sumita Arora"],

"price":[300,400,350,400,200],

"ISBN No":[978-81-7700-236-2,231-21-3300-236-3,432-31-4400-342-4,555-43-8800-456-2,666-65-7700-
358-9],

"Totalcopies":[12,11,23,43,90]}

df=pd.DataFrame(x)

df.to_csv("Book.csv",index=False)
y={"Customer_name":["Rahul","Akshay","Yuvraj","Himanshu","Saloni"],

"Book_name":["The art war","Life boat","Dark life","The guide","Poke of the box"]

,"Quantity":[1,3,4,5,6]}

df=pd.DataFrame(y)

df.to_csv("sale.csv",index=False)
z={"puchasher_name":["vinay book store","Arnav book store","Ashish book store","Jatin book
store","Vivek book store"],

"Book_name":["Robin hood","winter sister","7 shades","Code name god","lee child"],

"Quantity":[12,20,10,13,5]}

df=pd.DataFrame(z)

df.to_csv("purchase.csv",index=False)

while True:

print("1. Add a Book ")

print("2. Display Books ")

print("3. Search a Book ")

print("4. Delete a Book")

print("5. Update a Book")


print("6. Show Linechart of sale")

print("7. Bar Graph of Stock")

print("8. Exit")

ch=int(input("enter your choice"))

if ch==1:

d={}

df=pd.read_csv("Book.csv")

d['BOOK_id']=int(input("enter a BOOK_id"))

d['bookName']=input("enter a book Name")

d['publisher name']=input("enter the publisher name")

d['Author name']=input("enter the salary")

d['price']=int(input("enter a price"))

d['ISBN No']=input("enter a ISBN No")

d['Totalcopies']=int(input("enter a ISBN No"))

df1=pd.DataFrame(d,index=1)

pd.concat([df,df1],ignore_index=False)

df.to_csv("Book.csv")

elif ch==2:

df=pd.read_csv('Book.csv')

print(df)

elif ch==3:

print("1.search for Book Nmber number")

print("2 search for Book Name")

print("3 search for Author Name")

print("4 search for Publisher Name")

s=int(input("enter your choice"))

if s==1:
e=int(input("enter a Book ID"))

df=pd.read_csv("Book.csv")

print(df[df["BOOK_id"]==e])

elif s==2:

m=input("enter a Book name")

df=pd.read_csv("Book.csv")

print(df[df["bookName"]==m])

elif s==3:

d=input("enter a Author Name")

df=pd.read_csv("Book.csv")

print(df[df["Author name"]==d])

elif s==4:

d=input("enter a Publisher Name")

df=pd.read_csv("Book.csv")

print(df[df["publisher Name"]==d])

elif ch==4:

e=int(input("enter Book Number to be Deleted"))

df=pd.read_csv("Book.csv")

df.drop(df[df["BOOK_id"]==e].index,inplace=True)

df.to_csv("Book.csv",index=False)

elif ch==5:

df=pd.read_csv("Book.csv")

e=int(input("Enter BOOK number"))

n=input("enter a name!Press enter to skip")

if n=="":

pass

else:

df.loc[df["BOOK_id"]==e,"book Name"]=n
d=input("enter Author Name !Press enter to skip")

if d=="":

pass

else:

df.loc[df['BOOK_id']==e,'Author name']=d

d=input("enter publisher Name !Press enter to skip")

if d=="":

pass

else:

df.loc[df['BOOK_id']==e,'publisher name']=d

d=int(input("enter the price!Press 0 to skip"))

if d==0:

pass

else:

df.loc[df['BOOK_id']==e,'price']=d

d=input("enter the ISBN No.!Press Enter to skip")

if d=="":

pass

else:

df.loc[df['BOOK_id']==e,'ISBN No']=d

df.to_csv("Book.csv",index=False)

elif ch==6:

df=pd.read_csv("sale.csv")

plt.plot(df.Book_name,df.Quantity)

plt.show()

elif ch==7:
df=pd.read_csv("Book.csv")

plt.bar(df.bookName,df.Totalcopies)

plt.title("Total number of copies")

plt.show()

elif ch==8:

break

**********************************PROGRAM_FINISH************************************
OUTPUT

1). MAIN MENU


2). DISPLAY BOOKS
3). Search a book
4). Delete A Book
5). Update a book
6). linechart of sales
7). Bar graph of stock

FINISH

You might also like