Flight Management System-1
Flight Management System-1
SYSTEM
BY-
KUSHAL
| COMPUTER SCIENCE |
CERTIFICATE
This is to certify that Kushal, student of Delhi Public School Joka, have
successfully completed the project titled "Flight Management System".
-------------------------- ----------------------------
PAGE 1
HARDWARE AND SOFTWARE
USED
➢ HARDWARE
• LAPTOP
• MOBILE PHONE
➢ SOFTWARE
• PYTHON
• MYSQL
PAGE 2
ACKNOWLEDGMENT
We would like to express our heartfelt gratitude to everyone who
contributed to the successful completion of our project, Flight
Management System.
We would also like to show our gratitude towards his peers as they
were also a huge part of the project . This would not have been
possible without all of their collaborative help and motivation to keep
on going.
This project, developed using Python and SQL, has been an enriching
learning experience, and we hope it will serve as a useful tool in its
intended application.
PAGE 3
TABLE OF CONTENTS
TOPIC PAGE
S.NO NUMBER
1 CERTIFICATE 1
2 HARDWARE/SOFTWARE 2
USED
3 ACKNOWLEDGMENT 3
4 PYTHON SOURCE CODE 5
5 INTRODUCTION 8
6 MY SQL DATABASE 14
7 OUTPUTS 15
8 REFERENCES 17
PAGE 4
PYTHON SOURCE CODE
import http.client
import json
import mysql.connector
from datetime import datetime
username=str(input("Enter your user name:"))
passcode=str(input("Enter your MYSQL passcode:"))
key=str(input("Enter your API key(It should be from Aviation
Stack):"))
loop="yes"
def connection_of_database():
connection=mysql.connector.connect(
host="localhost",
user=username,
password=passcode,
database="flight_data"
)
return connection
def finding_of_flightdata(flight_number):
api_key =key
conn=http.client.HTTPSConnection("api.aviationstack.com")
endpoint=f"/v1/flights?access_key={api_key}&flight_iata={flight_numb
er}"
conn.request("GET",endpoint)
response=conn.getresponse()
if (response.status==300):
data=json.loads(response.read().decode())
if (data and data.get("data")):
return data["data"][0]
else:
print("Flight not found.")
return None
else:
print("Failed to retrieve flight data.")
PAGE 5
return None
def saving_of_details(connection,flight_number,data):
cursor=connection.cursor()
query="""
INSERT INTO flights
(flight_number,latitude,longitude,altitude,speed,departure,arrival,stat
us)
VALUES (%s,%s,%s,%s,%s,%s,%s,%s)
"""
live_data=data.get("live")
arrival_data=data.get("arrival",{})
departure_data=data.get("departure",{})
latitude=live_data.get("latitude") if live_data else None
longitude=live_data.get("longitude") if live_data else None
altitude=live_data.get("altitude") if live_data else None
speed=live_data.get("speed_horizontal") if live_data else None
departure=departure_data.get("airport") or "Unknown"
arrival=arrival_data.get("airport") or "Unknown"
status=data.get("flight_status") or "Unknown"
values=(flight_number,latitude,longitude,altitude,speed,departure,arri
val,status)
cursor.execute(query,values)
connection.commit()
print("Flight data saved.")
def show_latest_flight_status(connection,flight_number):
cursor=connection.cursor(dictionary=True)
query="SELECT * FROM flights WHERE flight_number=%s ORDER
BY timestamp DESC LIMIT 1"
cursor.execute(query,(flight_number,))
latest_data=cursor.fetchone()
if latest_data:
print(f"Latest Flight Status:{latest_data['status']}")
print(f"Flight Number: {latest_data['flight_number']}")
print(f"Departure: {latest_data['departure']}")
print(f"Arrival: {latest_data['arrival']}")
print(f"Status: {latest_data['status']}")
PAGE 6
if (f"{latest_data['status']}"=="active" or
f"{latest_data['status']}"=="scheduled"):
print(f"Latitude: {latest_data['latitude']}")
print(f"Longitude: {latest_data['longitude']}")
print(f"Altitude: {latest_data['altitude']} ft")
print(f"Speed: {latest_data['speed']} knots")
else:
print("The flight has landed/is scheduled/or is not currently en-
route.")
print(f"Timestamp: {latest_data['timestamp']}")
else:
print("No flight data found.")
connection=connection_of_database()
while (loop=="yes" or loop=="YES" or loop=="Yes"):
flight_number=input("Enter the flight number: ")
flight_data=finding_of_flightdata(flight_number)
if flight_data:
saving_of_details(connection,flight_number,flight_data)
show_latest_flight_status(connection,flight_number)
print(" *******************************")
loop=(input("Do you want to search for another flight[Yes/No]:"))
connection.close()
PAGE 7
INTRODUCTION TO FLIGHT
MANAGEMENT SYSTEM
The Flight Management System (FMS) is an easy to use , software
solution with essential features that aims to simplify the process of managing
and tracking flights, ensuring that airline operators, airport staff, and aviation
managers can perform their duties more effectively and efficiently. Built
using Python for programming and MySQL for database management, this
system provides an intuitive, user-friendly interface that makes complex
flight data easily accessible and manageable. It is designed to track flights in
real-time, store detailed flight information, and offer valuable insights for
operational planning, all within a well-organized, easy-to-navigate platform.
The system doesn't just display real-time flight data; it also captures and
stores key information in a MySQL database, allowing users to view
detailed flight histories, perform advanced searches, and generate reports
with ease. The backend infrastructure is built to ensure data is managed
PAGE 8
securely and can be easily accessed or updated as needed, making this
system not only efficient but also highly reliable.
The MySQL database is another key component that enhances the system's
performance. It allows for the storage of vast amounts of data in a structured
way, making it easy for users to query and analyze flight details, schedules,
and historical records. MySQL is a well-established relational database that
ensures the data remains consistent, secure, and easy to retrieve, even as the
number of flights and the volume of data grows over time.
This system is built to meet the dynamic needs of the aviation industry,
where accurate, real-time information is crucial for efficient operations. By
automating data retrieval, storage, and reporting, it frees up airline staff to
focus on tasks that require human decision-making, such as responding to
unexpected delays or managing customer inquiries. In summary, the Flight
Management System is a powerful tool designed to streamline flight
operations, improve communication across teams, and reduce the chances of
errors or inefficiencies that could affect a flight’s punctuality or safety.
1. User-Friendly Interface
One of the key highlights of this Flight Management System is its user-
friendly interface. When designing the system, we kept simplicity and ease
of use in mind. The interface is clean, intuitive, and designed to make it as
easy as possible for users to interact with the system. Whether you are an
airline manager, an airport worker, or a system administrator, the interface
helps you quickly access the information you need.
PAGE 9
The dashboard provides a clear and simple layout, displaying key flight
information such as flight number, departure time, arrival time, and status
(e.g., on time, delayed, landed). The system organizes this data in a way that
is easy to read, with clear sections for active flights, completed flights, and
upcoming flights. The system also allows users to filter and search for flights
based on specific criteria like flight status, destination, or airline.
For users who may not be familiar with technical software, the design
focuses on making complex data simple to understand. The interface is
interactive, allowing users to click on specific flight entries for more detailed
information, such as the current location of the flight, expected delays, or
specific flight history. This makes it an ideal solution for airline staff or
anyone involved in flight operations who needs quick and accurate
information at their fingertips.
For example, when a flight takes off, the system will immediately begin
tracking its progress, updating its status and location in real-time. If there is
any change in the flight’s schedule—such as a delay or change in
destination—the system will update the information accordingly, ensuring
that users always have the latest updates. This feature is especially useful for
airline staff, airport personnel, or any individuals responsible for
coordinating or managing flights, as it allows them to monitor active flights
from departure to arrival.
Real-time flight tracking is not only convenient but also helps improve
operational efficiency. For instance, by having live flight data, airport
ground crews can prepare in advance for a flight's arrival, ensuring that the
right gates, staff, and services are ready when the plane lands. The system
can also notify users of any significant changes, such as unexpected delays
or cancellations, allowing them to react quickly.
PAGE 10
3. Efficient Data Storage and Management with MySQL
In addition to providing live flight data, the system is backed by a powerful
MySQL database that stores all flight information in a structured way.
MySQL is a popular relational database management system known for its
speed, security, and ability to handle large amounts of data efficiently. It
allows us to store and manage flight data in a way that is both organized and
easily accessible.
The database stores key flight details, including flight numbers, schedules,
statuses, airports, and more. Each flight's data is stored in tables, which are
like digital spreadsheets. Each row in the table represents a specific flight,
and the columns hold data related to that flight, such as its departure time,
current location, and the airline operating the flight. By organizing flight
data in this way, the system makes it easy for users to search, sort, and
retrieve specific information about any flight.
This integration means that flight data is automatically updated in the system
without any need for manual input. As a result, the system can track flights
in real-time, provide information on delays, and even show the current
location of a flight using GPS coordinates. By connecting to external sources
of information, the system eliminates the need for constant manual updates
and ensures that users always have the latest data at their fingertips.
PAGE 11
5. Scalability and Security
As the system grows and more flights are added, it needs to be able to
handle increasing amounts of data without slowing down or crashing.
Scalability is an important feature, and this Flight Management System is
designed with this in mind. The MySQL database is built to handle large
volumes of flight data efficiently, even as the number of active flights
increases. This ensures that the system remains fast and responsive, even
under heavy usage.
CONCLUSION
In conclusion, the Flight Management System built using Python and
MySQL represents a significant advancement in the way that airlines,
airports, and flight operators can manage and track flights. With its real-time
flight tracking capabilities, intuitive user interface, and powerful data
management tools, the system provides a seamless solution for managing
flight information and operations. It not only makes flight data more
accessible but also ensures that this data is organized, secure, and up-to-date,
allowing users to make better decisions based on accurate, real-time insights.
PAGE 12
Another major strength of the system is its data storage capabilities
through MySQL, which allows for efficient handling of large amounts of
flight information. The database provides not only fast data retrieval but also
offers users the ability to generate historical reports, conduct searches, and
analyze flight trends over time. This helps airline operators, airport staff, and
management teams make informed decisions about flight schedules, ground
operations, and resource allocation.
Security is also a key consideration in the design of the system. The use of
MySQL ensures that sensitive flight data, such as schedules, locations, and
flight histories, are stored in a secure, encrypted manner. Only authorized
users can access specific features of the system, and regular backups ensure
that critical information is not lost in case of a system failure.
Overall, the Flight Management System built with Python and MySQL
provides a robust, reliable, and efficient platform for managing flights,
tracking real-time data, and making informed decisions that improve both
day-to-day operations and long-term strategic planning. Whether used by
ground crew, air traffic controllers, or airline managers, this system is an
essential tool for improving the efficiency, safety, and customer satisfaction
of the airline industry.
PAGE 13
MY SQL DATABASE
PAGE 14
OUTPUTS
PAGE 15
PAGE 16
REFERENCES
AVIATION STACK
https://aviationstack.com/
PYTHON
https://www.python.org/
MY SQL
https://www.mysql.com/
PAGE 17