PyRTCM

raw JSON →
1.1.12 verified Sat May 09 auth: no python

PyRTCM is a RTCM3 protocol parser and generator for Python. Version 1.1.12 supports Python >=3.10. It provides classes for reading, writing, and manipulating RTCM3 messages, commonly used in GNSS applications. Release cadence is irregular.

pip install pyrtcm
error TypeError: a bytes-like object is required, not 'str'
cause Passing a string instead of bytes to RTCMReader.
fix
Encode the string to bytes: data = data_str.encode('latin-1') or open file in binary mode 'rb'.
error pyrtcm.exceptions.RTCMStreamError: something went wrong
cause Malformed RTCM data or incomplete stream (e.g., missing sync byte).
fix
Ensure the data is a valid RTCM3 stream starting with 0xD3. Use RTCMReader with proper bytes input.
error ImportError: cannot import name 'RTCMReader'
cause Older version of pyrtcm (<1.0) may have different API. Or installed package is incomplete.
fix
Upgrade to latest version: pip install --upgrade pyrtcm. Check import path: from pyrtcm import RTCMReader.
error AttributeError: 'NoneType' object has no attribute 'identity'
cause Attempting to access parsed message attributes when parsed is None (parsing failed).
fix
Always check if parsed is not None before accessing attributes.
gotcha RTCMReader expects bytes, not str. Passing a string will raise TypeError or silently fail.
fix Use bytes or a bytes-like object. If reading from a file, open in binary mode.
gotcha RTCMReader is an iterator that yields tuples (raw_bytes, parsed_message). The second element can be None if parsing fails. Always check parsed is not None before accessing attributes.
fix Iterate as: for raw, parsed in reader: if parsed: ...
gotcha Only RTCM3 messages are supported; previous versions (RTCM2) are not handled. Attempting to parse RTCM2 data will result in errors.
fix Ensure input data conforms to RTCM3 standard (0xD3 sync byte).
gotcha When installing via pip, ensure wheel is available. On some platforms missing wheel may cause compilation issues for the C extension.
fix Install wheel: pip install wheel, then retry pip install pyrtcm.

Basic usage: create an RTCMReader from bytes and iterate over messages.

from pyrtcm import RTCMReader

# Read from a binary string
data = b'\xd3\x00...'  # RTCM3 raw bytes
rtr = RTCMReader(data)
for (raw, parsed) in rtr:
    if parsed:
        print(parched.identity)
        print(parched)