A Python-based airport departure analysis system that processes CSV datasets from a 12-hour European airport survey period.
This project allows the user to load airport flight data by entering a valid airport code and year.
The program then analyzes the selected dataset, displays the required results in the shell, saves them to a text file, and generates a histogram for a selected airline using graphics.py.
- Validates airport code input
- Validates year input
- Loads correctly named CSV files
- Analyzes airport departure data
- Displays key results in the shell
- Saves results to
results.txt - Draws a histogram for a selected airline
- Allows repeated analysis of multiple CSV files in one run
The program calculates:
- Total number of flights
- Total number of Terminal 2 departures
- Total number of flights under 600 miles
- Total number of Air France departures
- Total number of flights in temperatures below 15°C
- Average number of British Airways departures per hour
- Percentage of British Airways flights
- Percentage of delayed Air France departures
- Number of rainy hours
- Least common destination(s)
- Python
- CSV file handling
graphics.py
airport_analysis.py– main Python programgraphics.py– graphics library used for the histogram*.csv– airport datasets used as inputresults.txt– output file generated by the program
- Place the Python file,
graphics.py, and the CSV files in the same folder - Open the project in Python IDLE
- Run the Python file
- Enter a valid three-letter airport code
- Enter a valid year
- View the calculated results
- Enter a valid airline code to display the histogram
- Choose whether to process another file
- Airport code:
LHR - Year:
2025 - Airline code:
BA
- Airport and airline codes are validated before processing
- Lowercase input is accepted and converted
- Results are appended to
results.txtinstead of overwriting previous runs - The histogram is created using
graphics.pyonly
This project was developed as part of a Python programming coursework task focused on:
- input validation
- file handling
- list processing
- calculations
- text file output
- simple graphical visualization
Tharush Ranasinghe
Software Engineering Undergraduate