[go: up one dir, main page]

0% found this document useful (0 votes)
14 views31 pages

ip project file

The document certifies the project titled 'Library Information System' by students Megha Chaudhary and Raunak Rawat from International Public School for the session 2024-25, supervised by Mr. Shamshad Ali. It includes acknowledgments, hardware and software used, an overview of Python programming language, and details about data management using CSV files and MySQL. The project aims to manage cab bookings with features like booking details display, cab usage visualization, and data backup.
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)
14 views31 pages

ip project file

The document certifies the project titled 'Library Information System' by students Megha Chaudhary and Raunak Rawat from International Public School for the session 2024-25, supervised by Mr. Shamshad Ali. It includes acknowledgments, hardware and software used, an overview of Python programming language, and details about data management using CSV files and MySQL. The project aims to manage cab bookings with features like booking details display, cab usage visualization, and data backup.
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
You are on page 1/ 31

Session: 2024-25

CERTIFICATE
This is to certify that the Project entitled “Library
Information System. .” prepared by Megha
Chaudhary and Raunak Rawat.
Roll No: _____________ and
____________ respectively are the students of
International Public School, Ganga
Nagar, Meerut (School code: 60174) during the
session 2024-25 in partial fulfillment of AISSCE
2024-25 I.P. (065 New Course) project’s work has
been carried out under the supervision and guidance
of I.P. Teacher Mr. Shamshad Ali.
This report is prepared only for the Informatics
Practices examination and does not form part of any
other course undergone by the candidate.

Teacher’s Signature:
Mrs. Rana Lubana
(Principal)
ACKNOWLEDGEMENT

We feel elated to present our Informatics Practices


project for the session 2024-25, titled “Library
Information ÿ System.”.
This Project’s interface is developed using Python
(Front End) and using CSV Files (Backend) as the
software used is Open Source and as per CBSE
specifications.
I would like to thank our respected Principal Ma’am
Mrs. Rana Lubana for her support and
encouragement and our I.P. teacher Mr. Shamshad
Ali for their supervision and guidance to complete
this project work.

Student’s Signature:
1.
2.
The Hardware used:
While developing the system, the used hardware
are:
PC with Pentium Dual Core processor having 2
GB RAM, SVGA and other required devices.

The Software used:


Microsoft Windows® 10 as Operating System.
Anaconda-3 - Spyder (IDE of Python) as Front-
end Development environment.
CSV Files (Using MS Excel)
Microsoft Word 2010 for documentation.
About
What is of Python?
Python is a programming language that lets you work
quickly and integrate systems more effectively.
Python is a general-purpose interpreted, interactive,
object-oriented, and high-level programming language.
Python 3.0 was released in 2008. ... Although this version
is supposed to be backward incompatibles, later on many
of its important features have been backported to be
compatible with version 2.7.

Python Features
Python is a dynamic, high level, free open source and
interpreted programming language. It supports object-
oriented programming as well as procedural oriented
programming.
In Python, we don’t need to declare the type of variable
because it is a dynamically typed language.
For example, x = 10
Here, x can be anything such as String, int, etc.
There are many features in Python, some of which are
discussed below –

1. Easy to code:
Python is a high-level programming language. Python is
very easy to learn the language as compared to other
languages like C, C#, JavaScript, Java, etc. It is very easy
to code in python language and anybody can learn python
basics in a few hours or days. It is also a developer-
friendly language.

2. Free and Open Source:


Python language is freely available at the official website
www.python.org and you can download it. Since it is
open source, this means that source code is also available
to the public. So, you can download it as, use it as well as
share it.

3. Object-Oriented Language:
One of the key features of python is Object-Oriented
programming. Python supports object-oriented language
and concepts of classes, objects encapsulation, etc.

4. GUI Programming Support:


Graphical User interfaces can be made using a module
such as PyQt5, PyQt4, wxPython, or Tk in python. PyQt5
is the most popular option for creating graphical apps
with Python.
5. High-Level Language:
Python is a high-level language. When we write programs
in python, we do not need to remember the system
architecture, nor do we need to manage the memory.

6. Extensible feature:
Python is an Extensible language. We can write us some
Python code into C or C++ language and, we can compile
that code in C/C++ language.

7. Python is Portable language:


Python language is also a portable language. For example,
if we have python code for windows and if we want to run
this code on other platforms such as Linux, Unix, and
Mac then we do not need to change it, we can run this
code on any platform.

8. Python is Integrated language:


Python is also an integrated language because we can
easily integrated python with other languages like c, c++,
etc.

9. Interpreted Language:
Python is an Interpreted Language because Python code is
executed line by line at a time. like other languages C,
C++, Java, etc. there is no need to compile python code
this makes it easier to debug our code. The source code of
python is converted into an immediate form called
bytecode.

10. Large Standard Library


Python has a large standard library which provides a rich
set of module and functions, so you do not have to write
your own code for every single thing. There are many
libraries present in python for such as regular expressions,
unit-testing, web browsers, etc.

11. Dynamically Typed Language:


Python is a dynamically typed language. That means the
type (for example- int, double, long, etc.) for a variable is
decided at run time not in advance because of this feature
we don’t need to specify the type of variable.
About Python Pandas
Pandas is an open-source, BSD-licensed Python library
providing high-performance, easy-to-use data structures
and data analysis tools for the Python programming
language.
Python with Pandas is used in a wide range of fields
including academic and commercial domains including
finance, economics, Statistics, analytics, etc. In this
tutorial, we will learn the various features of Python
Pandas and how to use them in practice.

Pandas deals with the following three data


structures –

Series
DataFrame
Panel
These data structures are built on top of Numpy
array, which means they are fast.

Series is a one-dimensional labeled array capable


of holding data of any type (integer, string, float,
python objects, etc.). The axis labels are collectively
called index.
Data frame is a two-dimensional data structure, i.e.,
data is aligned in a tabular fashion in rows and
columns.

Features of DataFrame
Potentially columns are of different types
Size – Mutable
Labeled axes (rows and columns)
Can Perform Arithmetic operations on rows and
columns.

A panel is a 3D container of data. The term Panel


data is derived from econometrics and is partially
responsible for the name pandas − pan(el)-da(ta)-s.
The names for the 3 axes are intended to give some
semantic meaning to describing operations involving
panel data. They are −
items − axis 0, each item corresponds to a
DataFrame contained inside.
major_axis − axis 1, it is the index (rows) of each of
the DataFrames.
minor_axis − axis 2, it is the columns of each of the
DataFrames.
About
Matploptib is a low-level library of Python which is used
for data visualization. It is easy to use and emulates
MATLAB like graphs and visualization. This library is
built on the top of NumPy arrays and consist of several
plots like line chart, bar chart, histogram, etc.

Matplotlib is a plotting library for the Python


programming language and its
numerical mathematics extension NumPy. It provides an
object-oriented API for embedding plots into applications
using general-purpose GUI toolkits like Tkinter,
wxPython, Qt, or GTK. There is also a procedural "pylab"
interface
based on a state machine (like OpenGL), designed to
closely resemble that of MATLAB, though its use is
discouraged. SciPy makes use of Matplotlib.

Matplotlib was originally written by John D. Hunter.


Since then it has an active development community and is
distributed under a BSD-style license. Michael
Droettboom was nominated as matplotlib's lead developer
shortly before John Hunter's death in August 2012 and
was further joined by Thomas Caswell. Matplotlib is a
NumFOCUS fiscally sponsored project.

Matplotlib 2.0.x supports Python versions 2.7 through


3.10. Python 3 support started with Matplotlib 1.2.
Matplotlib 1.4 is the last version to support Python 2.6.
Matplotlib has pledged not to support Python 2 past 2020
by signing the Python 3 Statement.
CSV Files

The so-called CSV (Comma Separated Values) format is


the most common import and export format for
spreadsheets and databases. CSV format was used for
many years prior to attempts to describe the format in a
standardized way in RFC 4180. The lack of a well-
defined standard means that subtle differences often exist
in the data produced and consumed by different
applications. These differences can make it annoying to
process CSV files from multiple sources. Still, while the
delimiters and quoting characters vary,
the overall format is similar enough that it is possible to
write a single module which can efficiently manipulate
such data, hiding the details of reading and writing the
data from the programmer.

The csv module implements classes to read and write


tabular data in CSV format. It allows programmers to say,
“write this data in the format preferred by Excel,” or
“read data from this file which was generated by Excel,”
without knowing the precise details of the CSV format
used by Excel. Programmers can also describe the CSV
formats understood by other applications or define their
own special-purpose CSV formats.
About
The management of data in a database system is done by
means of a general-purpose software package called a
Database Management System (DBMS). Some
commercially available RDBMS are MS SQL Server, MS
ACCESS, INGRES, ORACLE, and Sybase. MySQL, the
most popular Open Source SQL database management
system, is developed, distributed, and supported by Oracle
Corporation. MySQL is named after co-founder Monty
Widenius's daughter, My. The name of the MySQL
Dolphin (our logo) is “Sakila,”.

MySQL is a Relational Database Management System


A database is a structured collection of data. It may be
anything from a simple shopping list to a picture gallery
or the vast amounts of information in a corporate network.
To add, access, and process data stored in a computer
database, you need a database management system such
as MySQL Server. Since computers are very good at
handling large amounts of data, database management
systems play a central role in computing, as standalone
utilities, or as parts of other applications.
MySQL is based on SQL
A relational database stores data in separate tables rather
than putting all the data in one big storeroom. This adds
speed and flexibility. The SQL part of “MySQL” stands
for “Structured Query Language.” SQL is the most
common standardized language used to access databases
and is defined by the ANSI/ISO SQL Standard. The SQL
standard has been evolving since 1986 and several
versions exist. In this manual, “SQL-92” refers to the
standard released in 1992, “SQL:1999” refers to the
standard released in 1999, and “SQL:2003” refers to the
current version of the standard.

MySQL software is Open Source


Open Source means that it is possible for anyone to use
and modify the software. Anybody can download the
MySQL software from the Internet and use it without
paying anything. If you wish, you may study the source
code and change it to suit your needs. The MySQL
software uses the GPL (GNU General Public License).

MySQL Database Server is very fast, reliable, & easy


to use
If that is what you are looking for, you should give it a
try. MySQL Server also has a practical set of features
developed in close cooperation with our users. You can
find a performance comparison of MySQL Server with
other database managers on our benchmark page. MySQL
Server was originally developed to handle large databases
much faster than existing solutions and has been
successfully used in highly demanding production
environments for several years. Although under constant
development, MySQL Server today offers a rich and
useful set of functions. Its connectivity, speed, and
security make MySQL Server highly suited for accessing
databases on the Internet.

MySQL Server works in client/server or embedded


systems
The MySQL Database Software is a client/server system
that consists of a multi-threaded SQL server that supports
different backends, several different client programs and
libraries, administrative tools, and a wide range of
application programming interfaces .

Main Features of MySQL


Written in C and C++ and Works on many different
platforms.
Uses multi-layered server design with independent
modules.
Provides transactional and non-transactional storage
engines.
Designed to make it relatively easy to add other storage
engines. This is useful if you want to provide an SQL
interface for an in-house database.
Uses a very fast thread-based memory allocation system.
Executes very fast joins using an optimized nested-loop
join.
Implements SQL functions using a highly optimized class
library that should be as fast as possible. Usually there is
no memory allocation at all after query initialization.
Provides the server as a separate program for use in a
client/server networked environment, and as a library that
can be embedded (linked) into standalone applications.
Such applications can be used in isolation or in
environments where no network is available.
Password security by encryption of all passwords when
you connect to a server. Support for large databases. We
use MySQL Server with databases that contain 50 million
records.
MySQL client programs can be written in many
languages. A client library written in C is available for
clients written in C or C++, or for any language that
provides C bindings.
Project Synopsis

2. Display Booking Details: Shows details about all


bookings (Booking ID, Customer ID, Cab ID, etc.).
3. Visualize Cab Usage: Displays a bar chart showing
how many times each cab has been booked.
4. Visualize Fare Statistics: Visualizes the relationship
between the distance and fare for each booking.
5. Backup of Data: Saves backups of cab and booking
details into separate CSV files.
6. Add New Cab: Allows adding a new cab with details
like driver's name and car model.
7. Make Booking: Allows users to make bookings by
selecting an available cab, entering pickup/drop-off
details, and calculating the fare.
8. Exit: Gracefully exits the system with a message and
clears the screen.

How it Works:
1. Add New Cab: The user can input details for a new
cab, which gets added to cabs.csv. The cab_id
is auto incremented.
2. Make Booking: The system checks for available
cabs, calculates the fare based on distance, and books
the cab by marking it as unavailable. The booking
details are stored in bookings.csv.
3. Data Visualization: The system generates visual
reports (bar charts and scatter plots) to show cab
usage and fare statistics.
File Structure:
1. cabs.csv: Contains cab details such as ID, driver's
name, car model, and availability.
2. bookings.csv: Contains booking details like booking
Project Code
(With screenshots)
Cabs.csv

Bookings.csv
.Py File
Cab Management System Program Code

import sys
import pandas as pd
import matplotlib.pyplot as plt
import time

# Display menu options


def display_menu():
print("***************************************************************\n")
print(" 1. DISPLAY CAB DETAILS\n")
print(" 2. DISPLAY BOOKING DETAILS\n")
print(" 3. VISUALIZE CAB USAGE\n")
print(" 4. VISUALIZE FARE STATISTICS\n")
print(" 5. BACKUP OF DATA\n")
print(" 6. EXIT\n")
print("***************************************************************\n")

# Load data from CSV files


def load_cabs():
try:
return pd.read_csv("cabs.csv")
except FileNotFoundError:
print("Cab data file not found! Please create a cab first.")
return pd.DataFrame(columns=["cab_id", "driver_name", "car_model",
"is_available"])

def load_bookings():
try:
return pd.read_csv("bookings.csv")
except FileNotFoundError:
print("Booking data file not found!")
return pd.DataFrame(columns=["booking_id", "customer_id", "cab_id",
"pickup_location",
"dropoff_location", "distance", "fare",
"booking_time"])

# Display Cab Details


def display_cabs():
cabs = load_cabs()
if not cabs.empty:
print("\n************** CAB DETAILS **************\n")
print(cabs)
else:
print("No cabs available.")
print("\n******************************************\n")

# Display Booking Details


def display_bookings():
bookings = load_bookings()
if not bookings.empty:
print("\n************** BOOKING DETAILS **************\n")
print(bookings)
else:
print("No bookings available.")
print("\n******************************************\n")

# Visualize Cab Usage (Bookings per Cab)


def visualize_cab_usage():
bookings = load_bookings()
if not bookings.empty:
cab_usage = bookings['cab_id'].value_counts()
plt.plot(cab_usage.index, cab_usage.values, color="blue")
plt.xlabel("Cab ID")
plt.ylabel("Number of Bookings")
plt.title("Cab Usage Statistics (Bookings per Cab)")
plt.show()
else:
print("No booking data available to visualize.")

# Visualize Fare Statistics (Fare vs Distance)


def visualize_fare_statistics():
bookings = load_bookings()
if not bookings.empty:
plt.plot(bookings['distance'], bookings['fare'], color="red")
plt.title("Fare vs Distance")
plt.xlabel("Distance (km)")
plt.ylabel("Fare ($)")
plt.show()
else:
print("No booking data available to visualize.")

# Backup of Data
def backup_data():
cabs = load_cabs()
bookings = load_bookings()
cabs.to_csv("cabs_backup.csv", index=False)
bookings.to_csv("bookings_backup.csv", index=False)
print("Backup completed successfully.\n")

# Add New Cab


def add_new_cab():
cabs = load_cabs()
driver_name = input("Enter Driver's Name: ")
car_model = input("Enter Car Model: ")
cab_id = len(cabs) + 1
new_cab = pd.DataFrame([[cab_id, driver_name, car_model, True]],
columns=["cab_id", "driver_name", "car_model",
"is_available"])
cabs = pd.concat([cabs, new_cab], ignore_index=True)
cabs.to_csv("cabs.csv", index=False)
print(f"New cab {car_model} added with ID {cab_id}.")

# Make a New Booking


def make_booking():
cabs = load_cabs()
bookings = load_bookings()
customer_id = input("Enter Customer ID: ")
pickup_location = input("Enter Pickup Location: ")
dropoff_location = input("Enter Dropoff Location: ")
distance = float(input("Enter Distance (km): "))
fare = distance * 10 # Assuming $10 per km
booking_time = pd.Timestamp.now().strftime('%Y-%m-%d %H:%M:%S')

# Find available cab


available_cab = cabs[cabs['is_available'] == True].iloc[0] if not
cabs[cabs['is_available'] == True].empty else None

if available_cab is None:
print("No available cabs. Please try again later.")
return

cab_id = available_cab['cab_id']
booking_id = len(bookings) + 1
new_booking = pd.DataFrame([[booking_id, customer_id, cab_id,
pickup_location, dropoff_location,
distance, fare, booking_time]],
columns=["booking_id", "customer_id", "cab_id",
"pickup_location",
"dropoff_location", "distance", "fare",
"booking_time"])
bookings = pd.concat([bookings, new_booking], ignore_index=True)

# Update cab availability


cabs.loc[cabs['cab_id'] == cab_id, 'is_available'] = False

bookings.to_csv("bookings.csv", index=False)
cabs.to_csv("cabs.csv", index=False)

print(f"Booking successful! Fare: ${fare}. Booking ID: {booking_id}. Cab ID:


{cab_id}.")

# Main Menu Loop


def main_menu():
while True:
display_menu()
try:
choice = int(input("Enter your choice: "))
if choice == 1:
display_cabs()
elif choice == 2:
display_bookings()
elif choice == 3:
visualize_cab_usage()
elif choice == 4:
visualize_fare_statistics()
elif choice == 5:
backup_data()
elif choice == 6:
print("\n************** EXIT **************\n")
print("\033[H\033[J") # Clear screen
print("\nProgram Terminating..... Please Wait")
time.sleep(5)
print("\033[H\033[J") # Clear screen
print("\nThanks for using the 'Cab Management System'.")
sys.exit(0)
else:
print("\nInvalid choice! Please enter a valid option.")
except ValueError:
print("\nInvalid input! Please enter a number from the menu.")
continue

if __name__ == "__main__":
main_menu()
Bibliography
We find the following resources helpful in completing our
project work -----
1. Textbook: Informatics Practices (Class XI & XII)
2. CBSE Study Material
3. https://www.w3schools.com/
4. https://www.Python.org
5. https://www.mysql.com/
6. https://www.anaconda.com/
7. Google Search engine

You might also like