### Install ARINC-424 Source: https://context7.com/jack-laverty/arinc424/llms.txt Commands to install the library from PyPI or set it up from a local source for development. ```bash # Install from PyPI pip install arinc424 # Or install from local source for development git clone https://github.com/jack-laverty/arinc424.git cd arinc424 python3 -m pip install -e . ``` -------------------------------- ### Install ARINC 424 Library Source: https://github.com/jack-laverty/arinc424/blob/main/README.md Install the latest release of the arinc424 library using pip. ```bash pip install arinc424 ``` -------------------------------- ### Install ARINC 424 from Local Source Source: https://github.com/jack-laverty/arinc424/blob/main/README.md Install an editable local version of the arinc424 library by cloning the repository and using pip. ```bash cd /arinc424 python3 -m pip install -e . ``` -------------------------------- ### Read ARINC-424 Files Source: https://context7.com/jack-laverty/arinc424/llms.txt Use arinc424.read_file() to process entire navigation database files by parsing each line sequentially. ```python import arinc424 # Parse all records in a file arinc424.read_file('path/to/FAACIFP18') ``` -------------------------------- ### Parse and Decode Record Types Source: https://context7.com/jack-laverty/arinc424/llms.txt Demonstrates how to iterate through raw record strings, identify their type, and decode them. ```python import arinc424 # Example: Parse different record types records = [ "SUSAP KSEAK1ASEA 110000119Y N47265700W122182910E019900429250SEA K11800018000CU00Y NAS SEATTLE-TACOMA INTL 045698808", # PA - Airport "SUSAD SEA K1 V 0 011490 HWN47260219W1222118000E0198 18000NAR SEATTLE 056438411", # D - VHF Navaid ] for rec in records: r = arinc424.Record() if r.read(rec): print(f"Record Type: {r.ident}") r.decode() ``` -------------------------------- ### Read and Parse an ARINC 424 File Source: https://github.com/jack-laverty/arinc424/blob/main/README.md Use the arinc424.read_file() function to parse every line of a given ARINC 424 file. ```Python path = 'path/to/arinc424_file' arinc424.read_file(path) ``` -------------------------------- ### Supported ARINC-424 Section Codes Source: https://context7.com/jack-laverty/arinc424/llms.txt Reference list of supported section codes and their corresponding record types. ```python # Supported section codes and their corresponding record types: # # Grid and Enroute Records: # AS - Grid MORA (Minimum Off-Route Altitude) # D - VHF Navaid (VOR, VORTAC, VOR/DME) # DB - NDB Navaid (Non-Directional Beacon) # EA - Enroute Waypoint # EM - Airways Marker # EP - Holding Pattern # ER - Enroute Airways # ET - Preferred Route # EU - Enroute Airways Restriction # EV - Enroute Communications # # Heliport Records: # HA - Heliport # HC - Heliport Terminal Waypoint # HD - Heliport SID # HE - Heliport STAR # HF - Heliport Approach Procedure # HK - Heliport TAA (Terminal Arrival Altitude) # HS - Heliport MSA (Minimum Sector Altitude) # HV - Heliport Communications # # Airport Records: # PA - Airport Reference Point # PB - Airport Gate # PC - Airport Terminal Waypoint # PD - Airport SID (Standard Instrument Departure) # PE - Airport STAR (Standard Terminal Arrival Route) # PF - Airport Approach Procedure # PG - Runway # PI - Localizer/Glideslope # PK - Airport TAA # PL - Airport MLS (Microwave Landing System) # PM - Localizer Marker # PN - Airport Terminal NDB # PP - Path Point # PR - Flight Planning ARR/DEP # PS - Airport MSA # PT - GLS Station (GBAS Landing System) # PV - Airport Communication # # Other Records: # R - Company Route # RA - Alternate Record # TC - Cruising Tables # TG - Geographical Reference Table # UC - Controlled Airspace # UF - FIR/UIR (Flight Information Region) # UR - Restrictive Airspace ``` -------------------------------- ### arinc424.read_file Source: https://context7.com/jack-laverty/arinc424/llms.txt Parses an ARINC-424 navigation data file. ```APIDOC ## arinc424.read_file ### Description Parses an ARINC-424 navigation data file. Supports silent mode to suppress console output. ### Parameters #### Arguments - **filepath** (string) - Required - Path to the navigation data file. - **output** (boolean) - Optional - Whether to print output to the console. Defaults to True. ``` -------------------------------- ### Read ARINC 424 File Source: https://context7.com/jack-laverty/arinc424/llms.txt Reads a single ARINC 424 navigation data file. Use `output=False` for silent mode. ```python import arinc424 # Parse without console output (silent mode) arinc424.read_file('path/to/navigation_data.txt', output=False) # Process FAA CIFP data files arinc424.read_file('/data/CIFP/FAACIFP18_230126') ``` -------------------------------- ### Read ARINC 424 Folder Source: https://context7.com/jack-laverty/arinc424/llms.txt Parses all ARINC 424 records from every file within a specified folder. Ideal for batch processing. ```python import arinc424 # Parse all files in a folder arinc424.read_folder('path/to/data/ARINC-424-18/') ``` -------------------------------- ### Export ARINC-424 File to JSON Source: https://context7.com/jack-laverty/arinc424/llms.txt Processes an entire ARINC-424 file and writes the parsed records into a formatted JSON file. ```python import json def export_file_to_json(input_path, output_path): records = [] with open(input_path) as f: for line in f.readlines(): r = arinc424.Record() if r.read(line): # Parse JSON string back to dict for proper array formatting record_data = json.loads(r.json(output=False)) records.append(record_data) with open(output_path, 'w') as f: json.dump(records, f, indent=2) export_file_to_json('FAACIFP18', 'navigation_data.json') ``` -------------------------------- ### Identify Primary and Continuation Records Source: https://context7.com/jack-laverty/arinc424/llms.txt Helper functions to distinguish between primary ARINC 424 records and their continuation records. Primary records contain main data, while continuation records provide supplementary information. ```python import arinc424 # Check if record is a primary record record = arinc424.Record() record.read("SUSAP KSEAK1ASEA 110000119Y N47265700W122182910E019900429250SEA K11800018000CU00Y NAS SEATTLE-TACOMA INTL 045698808") if record.primary(): print("This is a primary record") if record.hasCont(): print("This primary record has continuation records following") # Process a file and separate primary from continuation records def process_navigation_data(filepath): primary_records = [] continuation_records = [] with open(filepath) as f: for line in f.readlines(): r = arinc424.Record() if r.read(line): if r.primary(): primary_records.append(r) else: continuation_records.append(r) return primary_records, continuation_records # Note: Both functions return False if record hasn't been initialized with data empty_record = arinc424.Record() print(empty_record.primary()) # False print(empty_record.hasCont()) # False ``` -------------------------------- ### Read and Decode ARINC 424 Record Source: https://github.com/jack-laverty/arinc424/blob/main/README.md Initializes an ARINC 424 record object and reads a raw string into it. The decode() method then processes the data, printing a formatted table to the console by default. ```Python import arinc424 record = arinc424.Record() record.read("SUSAP KSEAK1ASEA 110000119Y N47265700W122182910E019900429250SEA K11800018000CU00Y NAS SEATTLE-TACOMA INTL 045698808") record.decode() # returns decocded record in a table as a string. Prints the table to console by default, output=False to stop this. ``` -------------------------------- ### arinc424.read_file() Source: https://context7.com/jack-laverty/arinc424/llms.txt Parses all ARINC-424 records contained within a specified file. ```APIDOC ## arinc424.read_file(filepath) ### Description Processes an entire navigation database or CIFP file by parsing each line using the internal parse() function. ### Parameters #### Arguments - **filepath** (string) - Required - The path to the ARINC-424 file to be processed. ``` -------------------------------- ### arinc424.read_folder Source: https://context7.com/jack-laverty/arinc424/llms.txt Parses all ARINC-424 records for every file in a given folder. ```APIDOC ## arinc424.read_folder ### Description Parses all ARINC-424 records for every file in a given folder. Useful for batch processing multiple navigation data files. ### Parameters #### Arguments - **folderpath** (string) - Required - Path to the folder containing navigation data files. ``` -------------------------------- ### Write Decoded ARINC 424 Output to Files Source: https://context7.com/jack-laverty/arinc424/llms.txt Saves decoded ARINC 424 records to files in either plaintext table format or JSON for further processing. ```python import arinc424 record = arinc424.Record() record.read("SUSAP KSEAK1ASEA 110000119Y N47265700W122182910E019900429250SEA K11800018000CU00Y NAS SEATTLE-TACOMA INTL 045698808") # Write as plaintext table with open("output.txt", "w") as f: f.write(record.decode(output=False)) # Write as JSON with open("output.json", "w") as f: f.write(record.json(output=False)) ``` -------------------------------- ### arinc424.parse() Source: https://context7.com/jack-laverty/arinc424/llms.txt Parses a single ARINC-424 record string and displays the decoded contents as a formatted table. ```APIDOC ## arinc424.parse(record, output=True) ### Description Parses a single 132-character ARINC-424 record string. It validates the record and decodes fields into human-readable formats. ### Parameters #### Arguments - **record** (string) - Required - The 132-character ARINC-424 record string. - **output** (boolean) - Optional - If True (default), displays the decoded data as a formatted table in the console. ### Response - **Returns** (boolean) - Returns True if parsing succeeded, False otherwise. ``` -------------------------------- ### Write Decoded ARINC 424 Record to File Source: https://github.com/jack-laverty/arinc424/blob/main/README.md Writes the decoded ARINC 424 record to a file. Supports both plain text and JSON formats using the decode() and json() methods respectively. ```Python f = open("output.txt", "w") # writes the record as plaintext f.write(record.decode()) # writes the record in JSON format f.write(record.json()) ``` -------------------------------- ### arinc424.search Source: https://context7.com/jack-laverty/arinc424/llms.txt Searches an ARINC-424 file for records matching specific substrings. ```APIDOC ## arinc424.search ### Description Search an ARINC-424 file and find all records containing given substrings. Supports single filter string or list of multiple filters that must all match. ### Parameters #### Arguments - **filepath** (string) - Required - Path to the file to search. - **filters** (string or list) - Required - Substring(s) to search for. ``` -------------------------------- ### arinc424.Record Class Source: https://context7.com/jack-laverty/arinc424/llms.txt Provides lower-level control for parsing and manipulating individual ARINC-424 records. ```APIDOC ## arinc424.Record ### Description The Record class provides lower-level control for parsing and manipulating ARINC-424 records. Use it when you need to access individual fields, check record types, or export to different formats. ### Methods - **read(data)**: Reads a raw ARINC-424 string into the record object. - **decode(output=True)**: Decodes the record into a table format. - **json(output=True, single_line=True)**: Exports the record to JSON format. - **primary()**: Returns True if the record is a primary record. - **hasCont()**: Returns True if the record has continuation records. ``` -------------------------------- ### Parse a Single ARINC 424 Record Source: https://github.com/jack-laverty/arinc424/blob/main/README.md Use the arinc424.parse() function to parse a single ARINC 424 record string. This function creates a Record object and decodes its fields. ```Python # parse_example.py import arinc424 arinc424.parse("SUSAP KSEAK1ASEA 110000119Y N47265700W122182910E019900429250SEA K11800018000CU00Y NAS SEATTLE-TACOMA INTL 045698808") ``` -------------------------------- ### Export ARINC 424 Record to JSON Source: https://context7.com/jack-laverty/arinc424/llms.txt Exports a parsed ARINC 424 record to JSON format. Useful for programmatic processing, API integration, or data storage. ```python import arinc424 record = arinc424.Record() record.read("SUSAP KSEAK1ASEA 110000119Y N47265700W122182910E019900429250SEA K11800018000CU00Y NAS SEATTLE-TACOMA INTL 045698808") # Export as single-line JSON (prints and returns string) json_str = record.json() # Output: {"Record Type": "S", "Customer / Area Code": "USA", "Section Code": "PA", ...} # Export as formatted JSON without printing json_str = record.json(output=False, single_line=False) print(json_str) # Output: # { # "Record Type": "S", # "Customer / Area Code": "USA", # "Section Code": "PA", # "Airport ICAO Identifier": "KSEA", # "ICAO Code": "K1", # "ATA/IATA Designator": "SEA", # ... # } # Write to file with open("output.json", "w") as f: f.write(record.json(output=False)) ``` -------------------------------- ### Search ARINC 424 Records Source: https://context7.com/jack-laverty/arinc424/llms.txt Searches an ARINC 424 file for records containing specified substrings. Supports single or multiple filters, where all must match. ```python import arinc424 # Search for all records containing "KSEA" (Seattle airport) arinc424.search('path/to/FAACIFP18', 'KSEA') # Output: Found 245 records that contain KSEA # Search with multiple filters (all must match) arinc424.search('path/to/FAACIFP18', ['KSEA', 'RW16']) # Output: Found 12 records that contain ['KSEA', 'RW16'] # Search for VOR navaids in a specific region arinc424.search('path/to/navdata.txt', ['D ', 'SEA']) ``` -------------------------------- ### Check ARINC 424 Record Type Source: https://github.com/jack-laverty/arinc424/blob/main/README.md Provides helper functions to determine if a record is a primary record or if it has continuation records. These functions return False if the record object has not been initialized with ARINC-424 data. ```Python # True if primary record, otherwise False record.primary() # True if record is primary record with at least one continuation record to follow, otherwise False record.hasCont() #NOTE: both of these functions will return False if the record object has not been initialised with ARINC-424 data ``` -------------------------------- ### ARINC 424 Record Class Source: https://context7.com/jack-laverty/arinc424/llms.txt Provides lower-level control for parsing and manipulating ARINC 424 records. Use for accessing individual fields, checking record types, or exporting. ```python import arinc424 # Create and read a record record = arinc424.Record() success = record.read("SUSAP KSEAK1ASEA 110000119Y N47265700W122182910E019900429250SEA K11800018000CU00Y NAS SEATTLE-TACOMA INTL 045698808") if success: # Decode and display as table table_string = record.decode() # Prints table and returns string # Decode without printing table_string = record.decode(output=False) # Access raw record data print(f"Raw record: {record.raw}") print(f"Record identifier: {record.ident}") # 'PA' for Airport # Access parsed fields for field in record.fields: print(f"{field.name}: {field.value}") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.