Notice To Airmen Parser module written in Python.
This provides a means to parse standard format ICAO NOTAMs, and extract useful information from them without having to do any string processing yourself.
Parsing a NOTAM is as easy as:
>>>s="""(A1912/15 NOTAMNQ) LOVV/QWPLW/IV/BO/W/000/130/4809N01610E001A) LOVV B) 1509261100 C) 1509261230E) PJE WILL TAKE PLACE AT AREA LAAB IN WALDEPSN:N480930 E0161028 RADIUS - 1NMF) GND G) FL130)""">>>n=notam.Notam.from_str(s)Now you can access all information provided in the NOTAM easily and natively:
>>>n.valid_fromdatetime.datetime(2015, 9, 26, 11, 0, tzinfo=datetime.timezone.utc)
>>>n.area
{'lat': '4809N', 'long': '01610E', 'radius': 1}You can also get a decoded form of the NOTAM, with all ICAO abbreviations expanded, with a single method call:
>>>print(n.decoded())
(A1912/15NOTAMNQ) LOVV/QWPLW/IV/BO/W/000/130/4809N01610E001A) LOVVB) 1509261100C) 1509261230E) ParachuteJumpingExerciseWILLTAKEPLACEATAREALAABINWALDEPosition:N480930E0161028RADIUS-1NMF) GroundG) FL130For a full list of the fields available in a Notam object, see its __init__ method in the code.
Tested on Python 3.5.
Parsing grammar implemented with Erik Rose's excellent module Parsimonious. To install it:
> pip install parsimonious