#!/usr/bin/env python # This doesn't work! I'm testing... # FAA_ATA100_examples/nav.py # # a simple example of using the FAA_ATA100 Python module to parse # FAA data # # Kyler Laird (Kyler@Lairds.com) # May, 2004 # # # This program uses the library file "FAA_ATA100.py". It is available # here. # http://aviationtoolbox.org/munge/FAA_ATA100.py # If it's not in your default path (such as in the current directory), # modify the system path to find it. import sys sys.path.append('../') import FAA_ATA100 # Specify the zip file containing the ATA-100 data. # Adjust the path as necessary to find the file as provided here. # http://aviationtoolbox.org/raw_data/FAA/ATA-100/current.zip FAA_data = FAA_ATA100.ATA100zip('../../raw_data/FAA/ATA-100/current.zip') # We're only going to look at APT records. # The description is here. # http://aviationtoolbox.org/old/ATA-100/Subscriber_File_Formats/Apt_rf.txt FAA_parsed_data = FAA_data.parse('NAV') # Iterate through each of the record types. for record_type in FAA_parsed_data.fields.keys(): print record_type # Dump the names we use for each of the fields. These names # are the first lines of the field descriptions from the # description file. for field_name in FAA_parsed_data.fields[record_type]: print '\t' + field_name ## Iterate over all of the APT records. for record in FAA_parsed_data: # What's the record type indicator? rti = record['RTI']