Airports Data
airportsdata is a Python library providing an extensive database of location and timezone data for nearly every operational airport and landing strip in the world. As of version 20260315, it contains over 28,000 entries with ICAO, IATA, name, city, country, elevation, latitude, longitude, and timezone information. It is actively maintained with frequent data updates, often on a monthly or bi-monthly basis.
Warnings
- gotcha The 'elevation' data for airports, representing the MSL elevation of the highest point of the landing area, is often inaccurate or approximate and should be used with caution.
- gotcha The database contains no historical data; closed airports are removed from the dataset. It only includes currently operational airports.
- gotcha IATA Multi Airport Cities (MACs) are not treated as individual airports within the main `airportsdata.load()` dataset. A separate function, `airportsdata.load_iata_macs()`, is provided to access data for airports belonging to IATA MACs.
- gotcha The database generally does not include seaplane bases or heliports unless they have an assigned IATA code. Similarly, surface transportation stations are not included, even if they possess an official IATA code.
Install
-
pip install airportsdata
Imports
- load
import airportsdata airports = airportsdata.load()
- load_iata_macs
import airportsdata iata_macs = airportsdata.load_iata_macs()
Quickstart
import airportsdata
# Load the entire airports database
airports = airportsdata.load()
# Get an airport by its ICAO code
ksea_airport = airports.get('KSEA')
if ksea_airport:
print(f"Airport Name: {ksea_airport['name']}")
print(f"City: {ksea_airport['city']}")
print(f"Country: {ksea_airport['country']}")
print(f"Timezone: {ksea_airport['tz']}")
else:
print("KSEA not found.")
# Iterate through all airports (example: find all airports in Germany)
print('\nAirports in Germany (first 5):')
germany_airports = [a for a in airports.values() if a['country'] == 'DE']
for i, airport in enumerate(germany_airports):
if i >= 5: break
print(f" - {airport['name']} ({airport['iata'] if airport['iata'] else 'N/A'})")