-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Currently, the FlightRadar24 API uses the character set ['P','C','M','J','T','H','B','G','D','V','O','N'] to identify flight categories (passenger, cargo, government, etc.). Looking this up in the official documentation to filter on a category is time consuming and annoying. It is very easy to create a Python Enum that maps the categories to the character literal:
class FlightCategory(Enum):
PASSENGER = "P"
CARGO = "C"
MILITARY_AND_GOVERNMENT = "M"
BUSINESS_JETS = "J"
GENERAL_AVIATION = "T"
HELICOPTERS = "H"
LIGHTER_THAN_AIR = "B"
GLIDERS = "G"
DRONES = "D"
GROUND_VEHICLES = "V"
OTHER = "O"
NON_CATEGORIZED = "N"Describe the solution you'd like
I would greatly appreciate it if the fr24apisdk would maintain this Enum for me. This way my text-editor can show me the list of up-to-date FlightRadar flight categories, and the mapping can be updated in a central location if FR24 decides to add new categories in the future.
Describe alternatives you've considered
I currently maintain my own Enum of FR24 flight categories. But this is clearly going to drift with time as it will only get updated whenever I check the official API documentation (likely only if/when something breaks).
Additional context
This character literal mapping already works nicely with the existing SDK API. I've tested the following code, and it works.
res = client.historic.flight_positions.get_light(
interval,
bounds=bounds
categories=[FlightCategory.GENERAL_AVIATION],
)