Usage Examples ============== Basic Usage ----------- Get All Beluga Flights ~~~~~~~~~~~~~~~~~~~~~~~ Retrieve all currently tracked Beluga aircraft: .. code-block:: python from pybelugaxl import get_beluga flights = get_beluga() for flight in flights: print(f"Aircraft: {flight.registration}") print(f"Route: {flight.from_airport} → {flight.to_airport}") print(f"Status: {flight.status}") print(f"Altitude: {flight.altitude} ft") print(f"Speed: {flight.ground_speed} kt") print(f"Position: {flight.position}") print("-" * 50) Filtering Examples ------------------ Filter by Status ~~~~~~~~~~~~~~~~ Get only aircraft that are currently flying: .. code-block:: python from pybelugaxl import get_beluga # Get only enroute flights flying = get_beluga(status="enroute") print(f"Found {len(flying)} aircraft in flight") for flight in flying: print(f"{flight.registration} at {flight.altitude} ft") Get aircraft on the ground: .. code-block:: python # Get aircraft on ground grounded = get_beluga(status="on_ground") for flight in grounded: print(f"{flight.registration} at {flight.from_airport}") Filter by Aircraft Registration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Track a specific Beluga by its registration: .. code-block:: python from pybelugaxl import get_beluga # Track F-GXLJ flights = get_beluga(registration="F-GXLJ") if flights: flight = flights[0] print(f"Found {flight.registration}") print(f"Current position: {flight.position}") print(f"Heading: {flight.heading}°") else: print("Aircraft not currently tracked") Filter by Airport ~~~~~~~~~~~~~~~~~ Find flights departing from a specific airport: .. code-block:: python from pybelugaxl import get_beluga # Flights from Toulouse Blagnac (LFBO) toulouse_departures = get_beluga(from_airport_icao="LFBO") for flight in toulouse_departures: print(f"{flight.registration}: LFBO → {flight.to_airport}") Find flights arriving at a specific airport: .. code-block:: python # Flights to Hamburg Finkenwerder (EDHI) hamburg_arrivals = get_beluga(to_airport_icao="EDHI") for flight in hamburg_arrivals: print(f"{flight.registration}: {flight.from_airport} → EDHI") print(f"ETA: {flight.eta}")