Python library for parsing and generating NMEA 0183 protocol messages used in GPS and marine navigation systems
77
Build a system to create and parse NMEA query messages for GPS device communication.
Create query messages that follow the NMEA query protocol format where one device requests specific sentence types from another device.
Parse incoming query message strings to extract the talker, listener, and requested sentence type information.
Render query message objects back to properly formatted NMEA strings.
@generates
def create_query_message(talker: str, listener: str, sentence_type: str) -> str:
"""
Create an NMEA query message.
Args:
talker: Two-character talker ID (e.g., "CC", "EC")
listener: Two-character listener ID (e.g., "GP", "GL")
sentence_type: Three-character sentence type to query (e.g., "GGA", "RMC")
Returns:
Formatted NMEA query string with checksum (e.g., "$CCGPQ,GGA*2A")
"""
def parse_query_message(message: str) -> dict:
"""
Parse an NMEA query message string.
Args:
message: NMEA query string (e.g., "$CCGPQ,GGA*2A")
Returns:
Dictionary with keys 'talker', 'listener', 'sentence_type', and 'is_query'
Example: {'talker': 'CC', 'listener': 'GP', 'sentence_type': 'GGA', 'is_query': True}
"""Provides NMEA 0183 protocol parsing and generation support.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-pynmea2docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10