Add flight number, airport codes, and connecting airports extraction#67
Open
rsatija wants to merge 3 commits intoAWeirdDev:mainfrom
Open
Add flight number, airport codes, and connecting airports extraction#67rsatija wants to merge 3 commits intoAWeirdDev:mainfrom
rsatija wants to merge 3 commits intoAWeirdDev:mainfrom
Conversation
- Add flight_number field to Flight dataclass in schema.py - Implement flight number extraction from data-travelimpactmodelwebsiteurl attribute - Support extraction for multiple airlines including Delta, JetBlue, and Frontier - Add debug output for Delta and Frontier flights to help with development - Update test scripts to display flight numbers in output - Fix extraction logic to search within individual flight items instead of entire document
- Add departure_airport and arrival_airport fields to Flight dataclass - Extract airport codes from data-travelimpactmodelwebsiteurl attribute - Support extraction for all airlines (Delta, JetBlue, American, Frontier, etc.) - Update test script to display airport codes in output - Airport codes are extracted from URL patterns like 'itinerary=JFK-LAX-F9-2503-20250801'
Contributor
|
What's the point of |
Manouchehri
suggested changes
Jul 9, 2025
Contributor
Manouchehri
left a comment
There was a problem hiding this comment.
TypeError: Flight.__init__() got an unexpected keyword argument 'connecting_airports'
Contributor
|
Would be nice if this could get the connecting flight numbers too. :) |
Contributor
I fixed this in #68. |
Author
|
Thanks! The reason the airport codes may not be the same is that some searches span multiple airports (i.e. NYC covers a few, so its helpful to know which specific airport is for a particular flight) |
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
|
Doesn't |
…field to Flight dataclass - Improve error handling to show relevant HTML parts instead of full page - Fix connecting airports extraction logic for multi-segment flights
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Submitting this as a PR in case others find this useful. Note that this has been vibecoded with a fair amount of testing and is working well, but may have unanticipated bugs. Happy to continue to update if its helpful.
Summary
Enhanced the flight data extraction capabilities to include flight numbers, departure/arrival airport codes, and connecting airports for multi-segment flights.
Changes Made
New Fields Added to Flight Dataclass
flight_number: Extracted from itinerary URL data attributesdeparture_airport: First airport in the itineraryarrival_airport: Last airport in the itineraryconnecting_airports: List of intermediate airports for connecting flightsEnhanced HTML Parsing Logic
data-travelimpactmodelwebsiteurlattribute