🐋 pybelugaxl Documentation
Overview
pybelugaxl allows you to:
- Track live BelugaXL aircraft positions and flight status
- Filter flights by registration, status, origin and destination
- Get detailed flight information including altitude, speed, heading
- Get global information about the fleet
- Easily fetch pictures of the planes
Installation
Use pip to install the module with the following command:
Quick Start
Here's a simple example to get all active BelugaXL flights that are currently listed on FlightRadar24:
No Beluga flights right now?
If no BelugaXL planes are currently flying, use demo=True.
For regular usage, use:
from pybelugaxl import get_beluga
# Get all Beluga flights
flights = get_beluga()
for flight in flights:
print(f"{flight.registration}: {flight.from_airport} → {flight.to_airport}")
print(f" Altitude: {flight.altitude} ft, Speed: {flight.ground_speed} kt")
Filter by criteria:
# Get only flights that are enroute
enroute_flights = get_beluga(status="enroute")
# Get flights from a specific airport
toulouse_flights = get_beluga(from_airport_icao="LFBO")
# Track a specific aircraft
specific_beluga = get_beluga(registration="F-GXLJ")
Documentation
Functions
get_beluga
Parameters:
registration(str, optional): Filter by aircraft registration (e.g., “F-GXLJ”)status(str, optional): Filter by flight status, either "enroute" or "on_ground"from_airport_icao(str, optional): Filter by departure airport ICAO code (e.g., “LFBO”)to_airport_icao(str, optional): Filter by destination airport ICAO codezone(str | tuple, optional): Filter by zone name or a tuple of latitude, longitude, range in km (e.g., "france" or (48.8566, 2.3522, 100))demo(bool, optional): Whether demo mode should be enabled or not, in demo mode mock data is returned
is_beluga_in_zone
Parameters:
zone(str | tuple): Filter by zone name or a tuple of latitude, longitude, range in km (e.g., "france" or (48.8566, 2.3522, 100))registration(str, optional): Filter by aircraft registration (e.g., “F-GXLJ”)status(str, optional): Filter by flight status, either "enroute" or "on_ground"from_airport_icao(str, optional): Filter by departure airport ICAO code (e.g., “LFBO”)to_airport_icao(str, optional): Filter by destination airport ICAO code
Returns:
- bool: True if there's a beluga flight within the specified zone, False otherwise
get_beluga_fleet_status
This function takes no parameters and returns the current status of the BelugaXL fleet (number of planes in the air, on the ground, etc..).
get_fleet_data
Parameters:
registration(str, optional): Filter by aircraft registration (e.g., “F-GXLJ”)
Returns:
- list[BelugaFleetData]: A list of BelugaFleetData objects containing static data about the fleet or about a specific plane.
get_images
Parameters:
registration(str, optional): Filter by aircraft registration (e.g., “F-GXLJ”) If not provided, a random BelugaXL registration is selectedlimit(int, optional): The number of images to retrieve (default is 3, max is 15)
Data Models
BelugaState
Represents the current state of a Beluga aircraft.
Attributes
id: Unique flight identifierregistration: Aircraft registration numberfrom_airport: Departure airport nameto_airport: Destination airport namescheduled_departure: Scheduled departure time (Unix timestamp)scheduled_arrival: Scheduled arrival time (Unix timestamp)real_departure: Actual departure time (Unix timestamp)real_arrival: Actual arrival time (Unix timestamp, None if not landed)eta: Estimated time of arrival (Unix timestamp)altitude: Current altitude in feetground_speed: Current ground speed in knotsheading: Current heading in degrees (0-360)position: Current position as (latitude, longitude)status: Flight status - "enroute", "on_ground", or "unknown"last_update: Last data update time (Unix timestamp)
BelugaPhoto
An image of a Beluga aircraft.
Attributes
registration: Aircraft registration numberurl: URL of the imagelocation: Location where the photo was takenphotographer: Name of the photographerdate_taken: Date the photo was takendate_uploaded: Date the photo was uploaded
BelugaFleetData
Static data about the Beluga fleet or about a specific plane in the fleet
Attributes
total_planes: Total number of Beluga planes in the fleetbase_airport_icao: ICAO code of the base airport for the fleetplane_type_icao: ICAO code of the plane typeoperator_icao: ICAO code of the operator of the fleetxl_number: The unique number of the plane in the fleetmsn: Manufacturer Serial Number of the planestatus: Current status of the planesource: Sources of the data
Exceptions
To be added one day (probably never..)