Akki Ka Project
Akki Ka Project
First and foremost, I would like to thank our school management for
giving us such a well-equipped and modern lab to learn all the basic and
advanced features of Python and MySQL.
I would also like to thank my parents and friends who helped me and
the Almighty God who gave me strength and inspiration in achieving
this task.
CERTIFICATE
Date: _______________________
The Backend
The backend is the end that is not visible but that processes the user-
requests as received by the front end. The back end handles all
database access through one or more servers. It is responsible for
processing data for user’s queries and requests.
INTRODUCTION
Basic Module:
• Add( ):It is function used to add details after the details has
been entered once.
Data Visualization
LINE CHART:-
HISTOGRAM:-
# Main Menu
while True:
print("Library Management System")
print("1. Fetch data")
print("2. View Data Statistics")
print("3. Display Records")
print("4. Edit Records")
print("5. Search Records")
print("6. Data Visualization")
print("7. Data Analytics")
print("8. Exit")
option = int(input("Enter your choice: "))
if option == 1:
# Fetch data from CSV
library = pd.read_csv("Library_Management.csv", index_col=0)
print("Data fetched successfully!")
elif option == 2:
# Dataframe Statistics
print("\nData Statistics:")
print("Shape:", library.shape)
print("Columns:", library.columns.tolist())
print("Data Types:\n", library.dtypes)
print("Summary:\n", library.describe())
elif option == 3:
# Display Records
print("1. Display Top 5 Records")
print("2. Display Bottom 5 Records")
sub_choice = int(input("Enter your choice: "))
if sub_choice == 1:
print(library.head())
elif sub_choice == 2:
print(library.tail())
elif option == 4:
# Edit Records
print("1. Add New Book")
print("2. Delete Book")
edit_choice = int(input("Enter your choice: "))
if edit_choice == 1:
# Add New Book
new_book = {
"Title": input("Enter Title: "),
"Author": input("Enter Author: "),
"Year": int(input("Enter Year: ")),
"Copies": int(input("Enter Copies Available: "))
}
library = library._append(new_book, ignore_index=True)
print(library)
print("Book added successfully!")
elif edit_choice == 2:
# Delete Book
title = input("Enter Title of the book to delete: ")
library = library.drop(library.index[library["Title"]==f"{title}"])
print("Book deleted successfully!")
print(library)
elif option == 5:
# Search Records
title = input("Enter Title to search: ")
result = library[library["Title"].str.contains(title, case=False,
na=False)]
print("Search Results:\n", result)
elif option == 6:
# Data Visualization
print("1. Bar Plot (Books per Year)")
print("2. Pie Chart (Copies Distribution)")
vis_choice = int(input("Enter your choice: "))
if vis_choice == 1:
library["Year"].value_counts().sort_index().plot(kind="bar")
plt.title("Books Published Per Year")
plt.xlabel("Year")
plt.ylabel("Number of Books")
plt.show()
elif vis_choice == 2:
library["Copies"].plot(kind="pie", labels=library["Title"],
autopct="%1.1f%%")
plt.title("Copies Distribution")
plt.show()
elif option == 7:
# Data Analytics
print("1. Book with Maximum Copies")
print("2. Book with Minimum Copies")
analytics_choice = int(input("Enter your choice: "))
if analytics_choice == 1:
max_copies = library.loc[library["Copies"].idxmax()]
print("Book with Maximum Copies:\n", max_copies)
elif analytics_choice == 2:
min_copies = library.loc[library["Copies"].idxmin()]
print("Book with Minimum Copies:\n", min_copies)
elif option == 8:
# Exit
print("Exiting the system. Goodbye!")
break
else:
print("Invalid choice. Please try again.")
OUTPUTS
WHEN WE ENTER INTO THE LIBRARY MANAGEMENT SYSTEM
ON ENTERING CHOICE 1
Enter your choice: 1
Data fetched successfully!
Library Management System
1. Fetch data
2. View Data Statistics
3. Display Records
4. Edit Records
5. Search Records
6. Data Visualization
7. Data Analytics
8. Exit
Enter your choice:
ON ENTERING CHOICE 2
Data Statistics:
Shape: (10, 4)
Columns: ['Title', 'Author', 'Copies', 'Year']
Data Types:
Title object
Author object
Copies int64
Year int64
dtype: object
Summary:
Copies Year
count 10.000000 10.000000
mean 3.800000 1992.200000
std 2.616189 28.208746
min 1.000000 1930.000000
25% 2.000000 1984.250000
50% 3.500000 2000.500000
75% 4.750000 2008.500000
max 9.000000 2024.000000
Library Management System
1. Fetch data
2. View Data Statistics
3. Display Records
4. Edit Records
5. Search Records
6. Data Visualization
7. Data Analytics
8. Exit
Enter your choice:
ON ENTERING CHOICE 3
Enter your choice: 3
1. Display Top 5 Records
2. Display Bottom 5 Records
Enter your choice:
b. ON ENTERING CHOICE 2
ON ENTERING CHOICE 4
ON ENTERING CHOICE 6