Airport¶
- class passengersim.core.Airport¶
Bases:
objectAirport object containing geographic and operational information.
Represents an airport with location data, timezone information, and minimum connection time requirements.
Methods
__init__(*args, **kwargs)Attributes
IATA Airport code, but could be 4-letter ICAO code for non-IATA airports, etc.
ISO-3166 2-letter codes, i.e. AU, US, CH, etc.
Difference between local time and GMT, in hours.
Specified in degrees, negative numbers for the southern hemisphere.
Specified in degrees, negative numbers for the western hemisphere.
Maximum Connect Time, in minutes, Domestic to Domestic.
Maximum Connect Time, in minutes, Domestic to International.
Maximum Connect Time, in minutes, International to Domestic.
Maximum Connect Time, in minutes, International to International.
Minimum Connect Time, in minutes, Domestic flight to Domestic flight.
Minimum Connect Time, in minutes, Domestic flight to International flight.
Minimum Connect Time, in minutes, International flight to Domestic flight.
Minimum Connect Time, in minutes, International flight to International flight.
Airport name, any Unicode string.
For the US & Canada, 2 letters.
- code¶
IATA Airport code, but could be 4-letter ICAO code for non-IATA airports, etc.
- Returns:
str – The airport code.
- country¶
ISO-3166 2-letter codes, i.e. AU, US, CH, etc.
- Returns:
str – The country code.
- gmt_offset¶
Difference between local time and GMT, in hours.
Used to convert flight times from GMT/UTC to local time. The system handles overnight flights by detecting when arrival time is before departure time in local time and adding 24 hours to the duration calculation.
Example: Flight from LAX (gmt_offset=-8.0) departing 23:00 local, arriving JFK (gmt_offset=-5.0) at 07:00 local next day. The system correctly calculates the elapsed time accounting for both the timezone change and day boundary.
Typical values range from -12.0 to +14.0 hours.
- Returns:
float – The GMT offset in hours.
- latitude¶
Specified in degrees, negative numbers for the southern hemisphere.
- Returns:
float – The latitude in degrees.
- longitude¶
Specified in degrees, negative numbers for the western hemisphere.
- Returns:
float – The longitude in degrees.
- max_connect_time_dd¶
Maximum Connect Time, in minutes, Domestic to Domestic.
- Returns:
int – The maximum connect time in minutes for domestic to domestic connections. -1 means use the global default.
- max_connect_time_di¶
Maximum Connect Time, in minutes, Domestic to International.
- Returns:
int – The maximum connect time in minutes for domestic to international connections. -1 means use the global default.
- max_connect_time_id¶
Maximum Connect Time, in minutes, International to Domestic.
- Returns:
int – The maximum connect time in minutes for international to domestic connections. -1 means use the global default.
- max_connect_time_ii¶
Maximum Connect Time, in minutes, International to International.
- Returns:
int – The maximum connect time in minutes for international to international connections. -1 means use the global default.
- mct_dd¶
Minimum Connect Time, in minutes, Domestic flight to Domestic flight.
Airport-specific value. Default is 20 minutes if not explicitly set.
- Returns:
int – The MCT in minutes for domestic to domestic connections.
- mct_di¶
Minimum Connect Time, in minutes, Domestic flight to International flight.
Airport-specific value. Default is 30 minutes if not explicitly set.
- Returns:
int – The MCT in minutes for domestic to international connections.
- mct_id¶
Minimum Connect Time, in minutes, International flight to Domestic flight.
Airport-specific value. Default is 60 minutes if not explicitly set.
- Returns:
int – The MCT in minutes for international to domestic connections.
- mct_ii¶
Minimum Connect Time, in minutes, International flight to International flight.
Airport-specific value. Default is 60 minutes if not explicitly set.
- Returns:
int – The MCT in minutes for international to international connections.
- name¶
Airport name, any Unicode string.
- Returns:
str – The airport name.
- state¶
For the US & Canada, 2 letters. other codes might be QLD, NSW, etc.
- Returns:
str – The state or province code.