t.p.n.NMEAAdapter(object) : class documentation

The earliest possible year that data will be interpreted as. For example,
if this value is 1990, an NMEA 0183 two-digit year of
"96" will be interpreted as 1996, and a two-digit year of
"13" will be interpreted as 2013. (type: int)

A mapping of sentece types to specific fixes that are required to extract
useful information from data from those sentences. (type: dict of sentence types to callables that take self and modify
it in-place)

Set of unary callables that take an NMEAAdapter instance and extract useful
data from the sentence data, usually modifying the adapter's sentence data
in-place. (type: dict of native strings to unary callables)

Information on how to update partial information in the sentence data or
internal adapter state. For more information, see
_statefulUpdate's docstring. (type: See _statefulUpdate's docstring)

_ACCEPTABLE_UNITS =

A set of NMEA notations of units that are already acceptable (metric), and
therefore don't need to be converted. (type: frozenset of bytestrings)

_UNIT_CONVERTERS =

Mapping of NMEA notations of units that are not acceptable (not metric) to
converters that take a quantity in that unit and produce a metric quantity. (type: dict of bytestrings to unary callables)

_SPECIFIC_SENTENCE_FIXES =

A mapping of sentece types to specific fixes that are required to extract
useful information from data from those sentences. (type: dict of sentence types to callables that take self and modify
it in-place)

_FIXERS =

Set of unary callables that take an NMEAAdapter instance and extract useful
data from the sentence data, usually modifying the adapter's sentence data
in-place. (type: dict of native strings to unary callables)

yearThreshold =

The earliest possible year that data will be interpreted as. For example,
if this value is 1990, an NMEA 0183 two-digit year of
"96" will be interpreted as 1996, and a two-digit year of
"13" will be interpreted as 2013. (type: int)

_state =

The current internal state of the receiver. (type: dict)

_sentenceData =

The data present in the sentence currently being processed. Starts empty,
is filled as the sentence is parsed. (type: dict)

Does a stateful update of a particular positioning attribute.
Specifically, this will mutate an object in the current sentence data.

Using the sentenceKey, this will get a tuple containing, in
order, the key name in the current state and sentence data, a factory for
new values, the attribute to update, and a converter from sentence data (in
NMEA notation) to something useful.

If the sentence data doesn't have this data yet, it is grabbed from the
state. If that doesn't have anything useful yet either, the factory is
called to produce a new, empty object. Either way, the object ends up in
the sentence data.

Parameters

sentenceKey

The name of the key in the sentence attributes,
NMEAAdapter._STATEFUL_UPDATE dictionary and the adapter state. (type: str)

Fixes the units of a certain value. If the units are already acceptable
(metric), does nothing.

None of the keys are allowed to be the empty string.

Parameters

unit

The unit that is being converted from. If unspecified or
None, asks the current sentence for the unitKey.
If that also fails, raises AttributeError. (type: str)

unitKey

The name of the key/attribute under which the unit can be found in the
current sentence. If the unit parameter is set, this parameter
is not used. (type: str)

sourceKey

The name of the key/attribute that contains the current value to be
converted (expressed in units as defined according to the unit
parameter). If unset, will use the same key as the value key. (type: str)

valueKey

The key name in which the data will be stored in the
_sentenceData instance attribute. If unset, attempts to remove
"Units" from the end of the unitKey parameter. If
that fails, raises ValueError. (type: str)