{"id":3394,"library":"airportsdata","title":"Airports Data","description":"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.","status":"active","version":"20260315","language":"python","source_language":"en","source_url":"https://github.com/mborsetti/airportsdata/","tags":["airport","aerodrome","ICAO","IATA","location","timezone","data","aviation"],"install":[{"cmd":"pip install airportsdata","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Requires Python 3.10 or newer.","package":"python","optional":false}],"imports":[{"symbol":"load","correct":"import airportsdata\nairports = airportsdata.load()"},{"symbol":"load_iata_macs","correct":"import airportsdata\niata_macs = airportsdata.load_iata_macs()"}],"quickstart":{"code":"import airportsdata\n\n# Load the entire airports database\nairports = airportsdata.load()\n\n# Get an airport by its ICAO code\nksea_airport = airports.get('KSEA')\nif ksea_airport:\n    print(f\"Airport Name: {ksea_airport['name']}\")\n    print(f\"City: {ksea_airport['city']}\")\n    print(f\"Country: {ksea_airport['country']}\")\n    print(f\"Timezone: {ksea_airport['tz']}\")\nelse:\n    print(\"KSEA not found.\")\n\n# Iterate through all airports (example: find all airports in Germany)\nprint('\\nAirports in Germany (first 5):')\ngermany_airports = [a for a in airports.values() if a['country'] == 'DE']\nfor i, airport in enumerate(germany_airports):\n    if i >= 5: break\n    print(f\"  - {airport['name']} ({airport['iata'] if airport['iata'] else 'N/A'})\")\n","lang":"python","description":"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."},"warnings":[{"fix":"Verify elevation data with official Aeronautical Information Publications (AIP) if precision is critical.","message":"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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If historical airport data is required, a different data source will be necessary.","message":"The database contains no historical data; closed airports are removed from the dataset. It only includes currently operational airports.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use `airportsdata.load_iata_macs()` if you need to work with airports that are part of a Multi Airport City.","message":"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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For comprehensive data on seaplane bases, heliports, or transportation stations, consult specialized databases.","message":"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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'000':36 '20260315':31 '28':35 'activ':52 'aerodrom':68 'airport':1,21,67 'airportsdata':3 'aviat':74 'basi':66 'bi':64 'bi-month':63 'citi':42 'contain':33 'countri':43 'data':2,16,56,73 'databas':11 'elev':44 'entri':37 'everi':19 'extens':10 'frequent':55 'iata':40,70 'icao':39,69 'inform':49 'land':23 'latitud':45 'librari':7 'locat':13,71 'longitud':46 'maintain':53 'month':61,65 'name':41 'near':18 'often':58 'oper':20 'provid':8 'python':6 'strip':24 'timezon':15,48,72 'updat':57 'version':30 'world':27","created_at":"2026-04-11T17:26:14.894913+00:00","updated_at":"2026-04-15T19:48:00.395999+00:00","problems":[{"fix":"Install the package using pip: 'pip install airportsdata'.","cause":"The 'airportsdata' package is not installed in the Python environment.","error":"ModuleNotFoundError: No module named 'airportsdata'"},{"fix":"Use the correct function provided by 'airportsdata', such as 'airportsdata.load()'.","cause":"The function 'get_airport' does not exist in the 'airportsdata' module.","error":"ImportError: cannot import name 'get_airport' from 'airportsdata'"},{"fix":"Ensure that you are accessing data correctly, e.g., 'airports['JFK']' instead of 'airports('JFK')'.","cause":"Attempting to call a string as if it were a function, possibly due to incorrect usage of the 'airportsdata' data structure.","error":"TypeError: 'str' object is not callable"},{"fix":"Verify that the key exists in the dataset and is used correctly, e.g., 'airports.get('JFK')' to avoid exceptions.","cause":"The key 'JFK' does not exist in the 'airportsdata' dictionary, possibly due to missing data or incorrect key usage.","error":"KeyError: 'JFK'"},{"fix":"Refer to the module's documentation to use the correct functions, such as 'airportsdata.load()'.","cause":"The 'airportsdata' module does not have a 'find_airport' attribute, indicating incorrect function usage.","error":"AttributeError: module 'airportsdata' has no attribute 'find_airport'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"20260315","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/mborsetti/airportsdata","docs":"https://github.com/mborsetti/airportsdata/blob/main/README.rst","changelog":"https://github.com/mborsetti/airportsdata/blob/main/CHANGELOG.rst","pypi":"https://pypi.org/project/airportsdata/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}