Registry / data / airportsdata

airportsdata

JSON →
library20260315pypypi✓ verified 49d ago

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.

data
pip install airportsdata
Install & Compatibility
Where this runs
tested against v20260315 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.925 runs
installs and imports cleanly · install 0.0s · import 0.028s · 20.8MB
glibc
py 3.103.925 runs
installs and imports cleanly · install 1.6s · import 0.021s · 21MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

load
import airportsdata airports = airportsdata.load()
load_iata_macs
import airportsdata iata_macs = airportsdata.load_iata_macs()

This quickstart demonstrates how to load the airport database and retrieve information by ICAO code, as well as how to filter and iterate through the airport data.

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'})")
Debug
Known issues
gotchaThe '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.
fix
Verify elevation data with official Aeronautical Information Publications (AIP) if precision is critical.
affects: All versions
gotchaThe database contains no historical data; closed airports are removed from the dataset. It only includes currently operational airports.
fix
If historical airport data is required, a different data source will be necessary.
affects: All versions
gotchaIATA 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.
fix
Use `airportsdata.load_iata_macs()` if you need to work with airports that are part of a Multi Airport City.
affects: All versions
gotchaThe 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.
fix
For comprehensive data on seaplane bases, heliports, or transportation stations, consult specialized databases.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'airportsdata'
The 'airportsdata' package is not installed in the Python environment.
fix
Install the package using pip: 'pip install airportsdata'.
ImportError: cannot import name 'get_airport' from 'airportsdata'
The function 'get_airport' does not exist in the 'airportsdata' module.
fix
Use the correct function provided by 'airportsdata', such as 'airportsdata.load()'.
TypeError: 'str' object is not callable
Attempting to call a string as if it were a function, possibly due to incorrect usage of the 'airportsdata' data structure.
fix
Ensure that you are accessing data correctly, e.g., 'airports['JFK']' instead of 'airports('JFK')'.
KeyError: 'JFK'
The key 'JFK' does not exist in the 'airportsdata' dictionary, possibly due to missing data or incorrect key usage.
fix
Verify that the key exists in the dataset and is used correctly, e.g., 'airports.get('JFK')' to avoid exceptions.
AttributeError: module 'airportsdata' has no attribute 'find_airport'
The 'airportsdata' module does not have a 'find_airport' attribute, indicating incorrect function usage.
fix
Refer to the module's documentation to use the correct functions, such as 'airportsdata.load()'.
Upgrade
Version history
20260315latest on PyPI
Audit
Dependencies
pythonrequiredRequires Python 3.10 or newer.
Agent activity
83 hits · last 30 days
node
10
claudebot
4
seranking-bot
4
mj12bot
3
petalbot
3
ahrefsbot
3
oai-searchbot
2
Amazon
1
amazonbot
1
googlebot
1
Resources