Skip to main content

A python parser for the FAA CIFP

Project description

cifparse

A python parser for the FAA CIFP.

Versions

Version Description Release Date
2.0.1 Minor fixes to internal module handling. 2025-05-25
2.0.0 Major update. See MIGRATION.md for details. 2025-05-22
1.0.1 Minor fixes to SQL statements. 2025-04-24
1.0.0 Updated table handling to include additional detail and data types. 2024-12-11
0.9.3 Updated procedure handling (breaking changes) and database support. 2024-11-15
0.9.2 Minor fixes. 2024-07-13
0.9.0 Initial public release. 2024-07-13

A changelog is available in the CHANGELOG.md with additional detail and guidance.

Installation

Install using pip:

pip install cifparse

Usage

Usage is relatively straightforward. Setting the path to the file can be somewhat finnicky, as it will only accept relative paths. To keep things simple, place the CIFP file in your project directory. Otherwise, if you want to go up several folders into a download folder, it might end up looking like ../../../../Downloads/FAACIFP18.

Given the amount of data, parsing can take a moment. If dumping the data to a file, that can also add time. Dumping every airport to JSON can take around 15 seconds, and the resulting file is about 330MB.

Examples

Start by importing cifparse, setting the path to the CIFP file, and then parsing the data.

import cifparse

# Initialize the parser:
from cifparse import CIFP

# Set the relative path to where you have the CIFP file:
c = CIFP("FAACIFP18")

# Parse the data in the file:
c.parse()
# ...or parse only a specific subset by using any combination of the following:
c.parse_moras()
c.parse_vhf_navaids()
c.parse_ndb_navaids()
c.parse_enroute_waypoints()
c.parse_airway_markers()
c.parse_holds()
c.parse_airway_points()
c.parse_preferred_routes()
c.parse_airway_restrictions()
c.parse_enroute_comms()
c.parse_heliports()
c.parse_heli_terminal_waypoints()
c.parse_heli_procedures()
c.parse_heli_taas()
c.parse_heli_msas()
c.parse_heli_terminal_comms()
c.parse_airports()
c.parse_gates()
c.parse_terminal_waypoints()
c.parse_procedures()
c.parse_runways()
c.parse_loc_gss()
c.parse_company_routes()
c.parse_alternate_records()
c.parse_taas()
c.parse_mlss()
c.parse_terminal_markers()
c.parse_path_points()
c.parse_flight_plannings()
c.parse_msas()
c.parse_glss()
c.parse_terminal_comms()
c.parse_cruise_tables()
c.parse_reference_tables()
c.parse_controlled()
c.parse_fir_uir()
c.parse_restrictive()

Working with Entire Segments

After parsing the data, the results will be in the CIFP object, accessible via getters that return lists of the objects.

all_moras = c.get_moras()
all_vhf_navaids = c.get_vhf_navaids()
all_ndb_navaids = c.get_ndb_navaids()
all_enroute_waypoints = c.get_enroute_waypoints()
all_airway_markers = c.get_airway_markers()
all_holds = c.get_holds()
all_airway_points = c.get_airway_points()
all_preferred_routes = c.get_preferred_routes()
all_airway_restrictions = c.get_airway_restrictions()
all_enroute_comms = c.get_enroute_comms()
all_heliports = c.get_heliports()
all_heli_terminal_waypoints = c.get_heli_terminal_waypoints()
all_heli_procedures = c.get_heli_procedures()
all_heli_taas = c.get_heli_taas()
all_heli_msas = c.get_heli_msas()
all_heli_terminal_comms = c.get_heli_terminal_comms()
all_airports = c.get_airports()
all_gates = c.get_gates()
all_terminal_waypoints = c.get_terminal_waypoints()
all_procedures = c.get_procedures()
all_runways = c.get_runways()
all_loc_gss = c.get_loc_gss()
all_company_routes = c.get_company_routes()
all_alternate_records = c.get_alternate_records()
all_taas = c.get_taas()
all_mlss = c.get_mlss()
all_terminal_markers = c.get_terminal_markers()
all_path_points = c.get_path_points()
all_flight_plannings = c.get_flight_plannings()
all_msas = c.get_msas()
all_terminal_comms = c.get_terminal_comms()
all_fir_uir = c.get_fir_uir()
all_cruise_tables = c.get_cruise_tables()
all_reference_tables = c.get_reference_tables()
all_controlled = c.get_controlled()
all_restrictive = c.get_restrictive()

Exporting Data

Dictionaries

Each object has its own to_dict() method. This is useful when you need to dump the data to json:

from cifparse import CIFP
import json

c = CIFP("FAACIFP18")
c.parse_airports()
airports = c.get_airports()
airport_dicts = [item.to_dict() for item in airports]
with open("output.json", "w") as json_file:
    json.dump(airport_dicts, json_file, indent=2)
Database

Each object has its own to_db() method. This is useful when you would like the data to persist, or query it using standard database methods:

c = CIFP("FAACIFP18")
c.parse()
c.to_db("FAACIFP18.db")

NOTE: The resulting tables are somewhat less-optimally normalized than they could be. This is mostly to allow flexibility in querying. For example, the airway_points table can be queried directly to retrieve all points on the airways, or a summary can be found on airways in a way similar to using SELECT DISTINCT ... on a subset of fields. Airspace follows a similar principle.

CIFP Objects

A breakdown of the different objects can be found in the Docs directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cifparse-2.0.1.tar.gz (115.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cifparse-2.0.1-py3-none-any.whl (235.4 kB view details)

Uploaded Python 3

File details

Details for the file cifparse-2.0.1.tar.gz.

File metadata

  • Download URL: cifparse-2.0.1.tar.gz
  • Upload date:
  • Size: 115.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for cifparse-2.0.1.tar.gz
Algorithm Hash digest
SHA256 2bf5a66d8bd3957c1405e83e88b65d2cf58a30dacd3fb0efd33e96c52c1ecc09
MD5 eb4f66f6dcd040c6cd55548cb6a31e9c
BLAKE2b-256 d1f4a22cc7df1bfaab1150667c75760b7b65f7da193c0453e474f5d907733188

See more details on using hashes here.

File details

Details for the file cifparse-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: cifparse-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 235.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for cifparse-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d522d224f54a71470c75bb1c07370b044464f44f31ffb31ef91be3928780ddd
MD5 a3e2b8681995714539fc17bee68faa55
BLAKE2b-256 6b564c0501059fd7fd42488c2f90cd84696b401dbd97653c330c9b91fe95a378

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page