GithubHelp home page GithubHelp logo

devleaks / arinc424 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jack-laverty/arinc424

0.0 1.0 0.0 82.14 MB

A library for ARINC-424, the international standard file format for aircraft navigation data.

License: MIT License

Shell 0.04% Python 99.96%

arinc424's Introduction

ARINC-424

build

A python library for parsing and decoding ARINC-424, the international standard file format for aircraft navigation data.

Requirements

  • Python >= 3.10

Installation

Install the latest release with:

pip install arinc424

or clone the repository and install the package from local source for an editable local version of the library.

cd /arinc424
python3 -m pip install -e .

Getting Started

Parsing a Record

# parse_example.py

import arinc424

arinc424.parse("SUSAP KSEAK1ASEA     110000119Y N47265700W122182910E019900429250SEA K11800018000CU00Y NAS    SEATTLE-TACOMA INTL           045698808")
foo@bar:~$ python3 parse_example.py

+---------------------------------+----------------------------------+--------------------------------+
| Field                           | Raw                              | Decoded                        |
+---------------------------------+----------------------------------+--------------------------------+
| Record Type                     | 'S'                              | Standard                       |
| Customer / Area Code            | 'USA'                            | United States of America       |
| Section Code                    | 'PA'                             | Airport Reference Point        |
| Airport ICAO Identifier         | 'KSEA'                           | KSEA                           |
| ICAO Code                       | 'K1'                             | K1                             |
| ATA/IATA Designator             | 'SEA'                            | SEA                            |
| Continuation Record No          | '1'                              | Primary Record (with Cont.)    |
| Speed Limit Altitude            | '10000'                          | 10000 ft                       |
| Longest Runway                  | '119'                            | 11900 ft                       |
| IFR Capability                  | 'Y'                              | Official                       |
| Longest Runway Surface Code     | ' '                              |                                |
| Airport Reference Pt. Latitude  | 'N47265700'                      | N47265700                      |
| Airport Reference Pt. Longitude | 'W122182910'                     | W122182910                     |
| Magnetic Variation              | 'E0199'                          | 199 E                          |
| Airport Elevation               | '00429'                          | 00429                          |
| Speed Limit                     | '250'                            | 250 knots (IAS)                |
| Recommended Navaid              | 'SEA '                           | SEA                            |
| ICAO Code (2)                   | 'K1'                             | K1                             |
| Transition Altitude             | '18000'                          | 18000 ft                       |
| Transition Level                | '18000'                          | 18000 ft                       |
| Public Military Indicator       | 'C'                              | Public / Civil                 |
| Time Zone                       | 'U00'                            | GMT +8:00                      |
| Daylight Indicator              | 'Y'                              | Yes                            |
| Magnetic/True Indicator         | ' '                              |                                |
| Datum Code                      | 'NAS'                            | NAS                            |
| Airport Name                    | 'SEATTLE-TACOMA INTL           ' | SEATTLE-TACOMA INTL            |
| File Record No                  | '04569'                          | 04569                          |
| Cycle Date                      | '8808'                           | 1988, Release 08               |
+---------------------------------+----------------------------------+--------------------------------+

Parsing a File

This function calls arinc424.parse() for every line of a given file.

path = 'dir/to/some/arinc424_file'
arinc424.read_file(path)

The Record Class

The examples in the Getting Started section utilise the arinc424.parse() function. Under the hood this function is creating a Record object, populating the fields of the record object with data from the provided record, and then calling the decode() function. This can also be done manually.

Reading a Record

import arinc424

record = arinc424.Record()
record.read("SUSAP KSEAK1ASEA     110000119Y N47265700W122182910E019900429250SEA K11800018000CU00Y NAS    SEATTLE-TACOMA INTL           045698808")

Writing a Record to a File

In addition to printing to the console, decode() will return a string which can be written to a file.

f = open("output.txt", "w")

# writes the record as plaintext
f.write(record.decode())

# writes the record in JSON format
f.write(record.decode('json'))

arinc424's People

Contributors

jack-laverty avatar devleaks avatar bleve97 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.