tracktable.info.airports module

Module contents

class tracktable.info.airports.Airport[source]

Bases: object

Information about a single airport

iata_code

3-letter IATA airport identifier

Type

str

icao_code

4-leter ICAO airport identifier

Type

str

name

Human-readable airport name

Type

str

city

City where airport is located

Type

str

country

Country where airport is located

Type

str

position

(longitude, latitude, altitude) position of airport

Type

tuple

size_rank

Approximate rank among all the world’s airports

Type

int

utc_offset

Local time zone as an offset from UTC

Type

int

tracktable.info.airports.airport_information(airport_code)[source]

Look up information about an airport

Parameters

airport_code (str) – ICAO or IATA code for an airport

Returns

Airport object containing requested information.

Raises

KeyError – no such airport

tracktable.info.airports.airport_size_rank(airport_code)[source]

Return an airport’s global rank by size

Parameters

airport_code (str) – IATA or ICAO airport identifier

Returns

Integer ranking. 1 is the largest, higher values are smaller.

tracktable.info.airports.airport_tier(airport_code)[source]

Return an estimated tier for an airport

We divide airports roughly into 4 tiers (chosen purely by hand) for a classification task. This function lets us retrieve the tier assigned to any given airport.

Parameters

airport_code (str) – IATA/ICAO airport identifier

Returns

tier1, tier2, tier3 or tier4

Return type

String

Raises

KeyError – no such airport

tracktable.info.airports.all_airports()[source]

Return all the airport records we have

Returns

Unsorted list of airport objects.

tracktable.info.airports.build_airport_dict()[source]

Assemble the airport dictionary on first access

This function is called whenever the user tries to look up an airport. It checks to make sure the table has been populated and, if not, loads it from disk.

Returns

None

Side Effects:

Airport data will be loaded if not already in memory