Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

LibraryMgmt XII IP ProjectReportFinal

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

CHINMAYA VIDYALAYA

PALLAVUR

PROJECT REPORT ON
LIBRARY MANAGEMENT
AS PART OF INFORMATICS PRACTICES [065]
CLASS XII

Submitted by: Submitted to:


Nibha.N Mrs.K.Usha Baburaj
CERTIFICATE

This is to certify that the Informatics Practices Project work title


“library management system” is a bonafide work done by
_________________ of class XII of Chinmaya Vidyalaya Pallavur
under the guidance and supervision of Mrs K.Usha Baburaj during the
academic year 2022-23.

Signature of Signature of

INTERNAL EXAMINER EXTERNAL EXAMINER

Signature of Principal
ACKNOWLEDGEMENT

I would specially thank Mrs K .Usha Baburaj, our


informatic practices teacher for providing her valuable
guidance, suggestions and comments throughout the course of
project.

I would also like to express my sincere gratitude to our


Principal Mr. Jayan Kambrath for providing an opportunity
to work of investigatory project on the topic “library
management system”
TABLE OF CONTENTS

1. About the project

2. Short description of the modules

3. Implementation

4. Output screenshots

5. Limitations

6. Requirements and Bibliography


About the Project

This project is based on maintaining book details in library.


The main process includes adding, updating, analysing and
visualizing the book issue and book return

The project includes various functions of python pandas and


CSV libraries to perform various task as mentioned.
Short description of the modules
Pandas
Pandas is an open-source library that is made mainly for working with
relational or labelled data both easily and intuitively. It provides
various data structures and operations for manipulating numerical data
and time series. This library is built on top of the NumPy library.
Pandas is fast and it has high performance & productivity for users.

Advantages
 Fast and efficient for manipulating and analysing data.
 Data from different file objects can be loaded.
 Easy handling of missing data (represented as NaN) in floating point as
well as non-floating-point data
 Size mutability: columns can be inserted and deleted from DataFrame and
higher dimensional objects

CSV:
A CSV file (Comma Separated Values file) is a type of plain text file
that uses specific structuring to arrange tabular data. Because it's a
plain text file, it can contain only actual text data—in other words,
printable ASCII or Unicode characters. The structure of a CSV file is
given away by its name

MATPLOTLIB
Matplotlib is a comprehensive library for creating static, animated,
and interactive visualizations in Python. Matplotlib makes easy things
easy and hard things possible.
 Create publication quality plots.
 Make interactive figures that can zoom, pan, update.
 Customize visual style and layout.
IMPLEMENTATION

books.csv
bn bnam DO auth no no_of_bi no_of_bre balance_
o e P or lang btype c ssued turned books
22
- APJ
10 Abdu
- l
wings 20 kala Engl Autobiog
1 of fire 20 m ish raphy 10 5 0 5
10
-
10
- Paulo
Alche 20 cheo Engl
2 mist 20 el ish Novel 15 2 1 14

Source Code

import pandas as pd

import matplotlib.pyplot as plt

def main_menu():

print("\n--------library management system-----------\n")

print("1.create\import new dataframe")

print("2.library data analysis")

print("3.import data visualisation")


print("4.export dataframe to csv files")

def create_dataframe_menu():

print("\n------- Create dataframe -------\n")

print("1. Create Dataframe")

print("2. Import Dataframe from csv file")

print("3. Add/Modify Custom Index")

print("4. Add/Modify Custom Column Head")

print("5. Return to main menu")

def analysis_menu():

cols =
['bno','bname','DOP','author','lang','btype','noc','no_of_bissued','no_of_breturned','balance_bo
oks']

df = pd.DataFrame([],columns = cols) # Create an EmptyDataFrame

print("\n------- library_management -------\n")

print("1. Display All records")

print("2. Print first nth records")

print("3. Print last nth records")

print("4. Print All records in order of book_name")

print("5. Display library with maximum books")

print("6. Display student with minimum books")

print("7. Print distinct books")

print("8. Add a row to Dataframe")

print("9. Delete a row from Dataframe")

print("10. Return to main menu")

def visualisation_menu():

print("\n------- Visualisation using Matplotlib -------\n")


print("1. Plot Line graph (library)")

print("2. Plot Bar graph (library)")

print("3. Return to main menu")

cols =
['bno','bname','DOP','author','lang','btype','noc','no_of_bissued','no_of_breturned','balance_bo
oks']

df = pd.DataFrame([],columns = cols) # Create an EmptyDataFrame

while True:

main_menu()

ch = int(input("Select Option: "))

if ch == 1:

# Create New Dataframe

create_dataframe_menu()

ch = int(input("Select Option: "))

if ch == 1:

data = []#list

while True:

ch = input("Add Row [y/n]")

if ch.lower() == 'y':

bno = int(input("book Number: "))

bname = input("book Name: ")

dop= input("DOP in dd-mm-yyyy format: ")

aut=input("Enter author name:")

lang=input("language ")
bty=input("Book Type")

noc=int(input("Number of copies:"))

no_of_bissued = int(input("number of books issued "))

no_of_breturned = int(input("number of books returned "))

balance_books=(no_of_bissued)-no_of_breturned

data.append([bno,bname,dop,aut,lang,bty,noc,no_of_bissued,no_of_breturned,balance_books
])

else:

break

df = pd.DataFrame(data, columns = cols)

elif ch == 2:

file = input("File name: ")

df = pd.read_csv(file)

elif ch == 3:

index_list = input("Index List: ").split(",")

df.index = index_list

elif ch == 4:

column_list= input("Column List: ").split(",")

df.columns = column_list

print(df)

elif ch == 2:

while True:

# Student Data Analysis

analysis_menu()

ch = int(input("Select Option: "))


if ch == 1:

print(df)

elif ch == 2:

nth = int(input("Enter no of rows to display: "))

print(df.head(nth))

elif ch == 3:

nth = int(input("Enter number of rows to display: "))

print(df.tail(nth))

elif ch == 4:

print(df.sort_values(by='bname'))

elif ch == 5:

print(df[df['bname'] == df['bname'].max()])

elif ch == 6:

print(df[df['bname'] == df['bname'].min()])

elif ch == 7:

print(df['bname'].unique())

elif ch == 8:

data = []#list

while True:

ch = input("Add Row [y/n]")

if ch.lower() == 'y':

bno = int(input("book Number: "))

bname = input("book Name: ")

dop= input("DOP in dd-mm-yyyy format: ")

aut=input("Enter author name:")

lang=input("language: ")

bty=input("Book Type:")
noc=int(input("Number of copies:"))

no_of_bissued = int(input("number of books issued: "))

no_of_breturned = int(input("number of books returned :"))

balance_books=no_of_bissued-no_of_breturned

# df = df.append({"bno": bno, "bname":bname,"dop": dop,"aut":aut, "lang":


lang,"bty":bty,"noc":noc, "no_of_bissued":no_of_bissued, " no_of_breturned":
no_of_breturned, " balance_books": balance_books}, ignore_index=True)

data.append([bno,bname,dop,aut,lang,bty,noc,no_of_bissued,no_of_breturned,balance_books
])

df = pd.DataFrame(data, columns = cols)

else:

break

elif ch == 9:

print("1. Delete Row by Index")

print("2. Delete Row by bno.")

ch = int(input("Select Option: "))

if ch == 1:

idx = int(input("Index to delete: "))

df = df.drop(index = idx)

elif ch == 2:

admn = int(input("bno to delete: "))

df = df.drop(df[df["bno"] == bno].index)

else:

print("Wrong Option Selected! ")

print("Returning to main menu")

break

elif ch == 10:

print("Returning to main menu")


break

elif ch == 3:

file ="books.csv"

df = pd.read_csv(file)

while True:

# Student Data Visualisation

#'bno','bname','DOP','author','lang','btype','noc','no_of_bissued','no_of_breturned','balance_bo
oks']

visualisation_menu()

ch = int(input("Select Option: "))

if ch == 1:

plt.plot(df['bname'], df['noc'], label='noc', color = "blue", marker="*")

#plt.plot(df['bname'], df['no_of_bissued '], label='no_of_bissued ', color = "green",


marker="*")

plt.plot(df['bname'], df['no_of_breturned'], label='no_of_breturned', color =


"purple", marker="*")

plt.plot(df['bname'], df['balance_books'], label='balance_books', color = "yellow",


marker="*")

plt.xlabel("books", fontsize=12)

plt.ylabel("count", fontsize=12)

plt.title("count of books", fontsize=16)

plt.legend()

plt.show()

elif ch == 2:

x_values = df["bname"]

y_values = df['noc']
plt.bar(x_values, y_values, color = 'orange')

plt.xlabel("books", fontsize=12)

plt.ylabel("count", fontsize=12)

plt.title("book count Visualisation", fontsize=14)

plt.show()

elif ch == 4:

x_values = df["bname"]

y_values = df["author"]

plt.barh(x_values, y_values, color = 'magenta')

plt.xlabel("books", fontsize=12)

plt.ylabel("author", fontsize=12)

plt.title("books - author Visualisation", fontsize=16)

plt.show()

elif ch == 3:

print("Returning to main menu")

break

else:

print("Wrong Option Selected! ")

elif ch == 4:

# Export Dataframe to csv file

file = input("File name: ")

df.to_csv(file, index = False)

elif ch == 5:

# Exit

print("Bye ...")

exit()

else:
# Error Display and Exit

print("Error! Wrong option selected. ")

break

main_menue()
OUTPUT SCREENTS
1.add the records

2.display all the records

3.display the maximum books issued

3.plot a line chart


4.plot bar graph
LIMITATIONS

 Graphical interfacing can be added


 Exporting csv files to remote servers

REQUIREMENTS

 Computer System with min 2 GB RAM


 Python 3.7/3.8 or higher
 Windows/ Linux OS

BIBILOGRAPHY

 Class 12 Sumitha Aroara Informatics Practices Text


book
 www.python4csip.com

 http://python.mykvs.in

You might also like