Skip to content

[FEATURE] Enumerate the FlightRadar24 Flight Categories #18

@kcexn

Description

@kcexn

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],
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions