🎓 An educational Python project demonstrating GUI development, data analysis, and API interactions through a flight price analysis tool, with a focus on AirAsia flights. For learning purposes only.
This project is created strictly for EDUCATIONAL PURPOSES only. Web scraping may be against the terms of service of many websites and could be illegal in certain contexts. This code is meant to demonstrate programming concepts and should not be used for actual data collection from any website without proper authorization.
The creators and contributors of this project:
- Do not endorse unauthorized scraping of any website
- Are not responsible for any misuse of this code
- Recommend always checking and complying with a website's terms of service and robots.txt
- Suggest obtaining proper authorization before collecting any data from websites
A Python desktop application showcasing:
- GUI development with tkinter
- Data analysis with pandas
- API interaction patterns
- Thread management
- File I/O operations
- Error handling
- Event-driven programming
- 🔍 Search multiple destinations simultaneously
- 🔄 Support for both one-way and round-trip flights
- 📅 Weekend flight indicators
- 📊 Comprehensive price analysis
- 💾 Excel export of raw data and analysis
- 🎯 Customizable search parameters
- 🔍 Flexible sorting options
- Python 3.8 or higher
- Required Python packages (install via
pip install -r requirements.txt):- pandas
- requests
-
Clone the repository:
git clone https://github.com/yourusername/flight-analyzer-edu.git cd flight-analyzer-edu -
Create a virtual environment (recommended):
python -m venv venv # Windows .\venv\Scripts\activate # Linux/MacOS source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python airasiav2.py
-
Enter your AirAsia API access token
-
Configure search parameters:
- Select departure airport
- Choose destination airports (multiple selection supported)
- Set date range
- Choose flight type (one-way/round-trip)
- Set trip duration for round-trips
-
Click "Fetch Flight Data" to start the search
-
Results will be automatically exported to Excel
You can create a standalone executable using PyInstaller:
-
Install PyInstaller:
pip install pyinstaller
-
Create the executable:
# Windows pyinstaller --onefile --windowed --icon=app_icon.ico airasiav2.py # Linux/MacOS pyinstaller --onefile --windowed airasiav2.py
The executable will be created in the dist directory.
- The
--onefileflag creates a single executable file - The
--windowedflag prevents a console window from appearing - Add
--icon=path_to_icon.icoto set a custom icon (Windows) - The compiled executable can be found in the
distdirectory - First run may take longer due to unpacking
- The application maintains a
City_Codes_List.txtfile for airport codes - Default codes are provided if the file doesn't exist
- Add/remove codes through the GUI interface
- Changes are automatically saved
- Sort results by:
- Price (Low to High/High to Low)
- Trip duration
- Destination
- Weekend flight indicators for better planning
- Customizable trip duration range
- Excel export with separate sheets for each route
-
API Token Issues
- Ensure your AirAsia API token is valid and not expired
- Check for proper token formatting
-
Rate Limiting
- Adjust the delay between requests if encountering 417 errors
- Default delay is 2.5 seconds
-
Excel Export Issues
- Ensure Excel is not open while exporting
- Check write permissions in the directory
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This software is provided for educational purposes only. Any use of this code for scraping websites without proper authorization may violate:
- Website terms of service
- Applicable laws and regulations
- API usage agreements
Users are solely responsible for ensuring their use of this software complies with all applicable terms, conditions, and laws.
This project is licensed under the MIT License - see the LICENSE file for details.
This project serves as a learning resource for:
- Python programming concepts
- GUI development with tkinter
- Data analysis with pandas
- API interaction patterns
- Software architecture principles
Remember: Always obtain proper authorization before collecting data from any website or API.