Skip to content

Instantly share code, notes, and snippets.

@sam-drew
Last active December 14, 2019 12:20
Show Gist options
  • Select an option

  • Save sam-drew/c6a5cfa55b924a34e0f4736eb26452db to your computer and use it in GitHub Desktop.

Select an option

Save sam-drew/c6a5cfa55b924a34e0f4736eb26452db to your computer and use it in GitHub Desktop.
Extract airports which have an IATA code from the full dataset.
import json
data = None
extractedData = []
with open("airport-codes_json.json", "r") as read_file:
data = json.load(read_file)
for item in data:
if item.iata_code != None:
extractedData.append(item)
with open("iata_only.json", "w") as write_file:
json.dump(data, write_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment