A python parser for the FAA CIFP
Project description
cifparse
A python parser for the FAA CIFP.
Versions
| Version | Description | Release Date |
|---|---|---|
| 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cifparse-2.0.0.tar.gz.
File metadata
- Download URL: cifparse-2.0.0.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6a00d5bdcc9b5f3e0a656b45fc14e99112d89fc43355838fc4b6759305e3d9f
|
|
| MD5 |
12e6904bc38bbe28d38768b1ca12f46e
|
|
| BLAKE2b-256 |
5a041fca586c23b2351dd06e3c4c13db8993610ece725b9237e64ea5014ed9f6
|
File details
Details for the file cifparse-2.0.0-py3-none-any.whl.
File metadata
- Download URL: cifparse-2.0.0-py3-none-any.whl
- Upload date:
- Size: 27.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6df455e8d7e9d9acac7791199592bb4479f8e962c75f862b657b3a7654b0c8b0
|
|
| MD5 |
aae0d3378febbbeae8893552f5732710
|
|
| BLAKE2b-256 |
0e16cba9f25958412f4ee58368085c43f0b5324cda3351984264749ce419ea39
|