Last-minute travel mishaps are tricky to deal with. Because all we did was use a bunch of flight-tracking apps on our phones. If you thought what we did was pretty cool, it isn’t. What’s more? We also selected a new flight with a lower chance of a delay and landed home without any further issues, unlike many others who were stuck at the airport. But, we were well prepared for it beforehand. During our recent trip, our flight back home was rescheduled and the passengers panicked. set_flight_tracker_config ( flight_tracker. get_flight_tracker_config () flight_tracker. Note: creating a new FlightTrackerConfig instance means resetting all parameters to default. Get the current configuration with the get_flight_tracker_config() method, that returns a FlightTrackerConfig You can also use keyword arguments directly to the method. It receives a FlightTrackerConfig dataclass instance, but Set it by using the set_flight_tracker_config(.) method. get_distance_from ( airport ) print ( f "The flight is km away from the airport." ) Setting and getting Real-time Flight Tracker parameters: get_airport ( "KJFK" ) distance = flight. Returns the distance between the self instance and another entity in kilometers. The Flight and Airport classes inherit from Entity, which contains the get_distance_from(.) method. get_airport ( code = "VNLK", details = True ) Getting the distance between flights and airports: Getting airport by ICAO or IATA: lukla_airport = fr_api. There are more configurations that you may set by using the set_flight_tracker_config(.) method. get_flights ( aircraft_type = aircraft_type airline = airline_icao, bounds = bounds ) get_bounds ( zone ) emirates_flights = fr_api. See the example below: airline_icao = "UAE" aircraft_type = "B77W" # You may also set a custom region, such as: bounds = "73,-12,-156,38" zone = fr_api. Or obtained by the get_zones() method), aircraft registration or aircraft type. The get_flights(.) method has some parameters to search for flights by: area line, bounds (customized coordinates get_flights ( bounds = bounds ) Filtering flights and airports: # Your point is 52☃4'04.7"N 13☁6'57.5"E from Google Maps and radius 2km bounds = fr_api. The get_bounds_by_point(.) method has parameters latitude and longitude for your position and radius for the distance in meters from your position to designate a tracking area. When you need to reach more than 100 flights you can use additional parameter page to view other pages. get_airport_details ( icao )Īrrivals and departures can have a limit flight_limit (max value is 100) to display. Or get more information about a specific airport such as: runways, weather, arrived flights, etc. set_flight_details ( flight_details ) print ( "Flying to", flight. You can also get more information about a specific flight such as: estimated time, trail, aircraft details, etc. get_zones () Getting flight and airport details Getting airlines list: airlines = fr_api. Getting airports list: airports = fr_api. from FlightRadar24 import FlightRadar24API fr_api = FlightRadar24API () Import the class FlightRadar24API and create an instance of it. Installing FlightRadarAPI: pip install FlightRadarAPI If you want to use the data collected using this SDK commercially, you need to subscribe to the Business plan. Unofficial SDK for FlightRadar24 written in Python 3.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |