{"id":28100,"library":"pyrtcm","title":"PyRTCM","description":"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.","status":"active","version":"1.1.12","language":"python","source_language":"en","source_url":"https://github.com/semuconsulting/pyrtcm","tags":["rtcm","rtcm3","gnss","protocol-parser"],"install":[{"cmd":"pip install pyrtcm","lang":"bash","label":"Default installation"}],"dependencies":[],"imports":[{"note":"RTCMReader is exported at package level, not from submodule rtcm.","wrong":"from pyrtcm.rtcm import RTCMReader","symbol":"RTCMReader","correct":"from pyrtcm import RTCMReader"},{"note":"Correct import for message object.","symbol":"RTCMMessage","correct":"from pyrtcm import RTCMMessage"},{"note":"RTCMStream is exported at package level.","wrong":"from pyrtcm.stream import RTCMStream","symbol":"RTCMStream","correct":"from pyrtcm import RTCMStream"}],"quickstart":{"code":"from pyrtcm import RTCMReader\n\n# Read from a binary string\ndata = b'\\xd3\\x00...'  # RTCM3 raw bytes\nrtr = RTCMReader(data)\nfor (raw, parsed) in rtr:\n    if parsed:\n        print(parched.identity)\n        print(parched) \n","lang":"python","description":"Basic usage: create an RTCMReader from bytes and iterate over messages."},"warnings":[{"fix":"Use bytes or a bytes-like object. If reading from a file, open in binary mode.","message":"RTCMReader expects bytes, not str. Passing a string will raise TypeError or silently fail.","severity":"gotcha","affected_versions":"all"},{"fix":"Iterate as: for raw, parsed in reader: if parsed: ...","message":"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.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure input data conforms to RTCM3 standard (0xD3 sync byte).","message":"Only RTCM3 messages are supported; previous versions (RTCM2) are not handled. Attempting to parse RTCM2 data will result in errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Install wheel: pip install wheel, then retry pip install pyrtcm.","message":"When installing via pip, ensure wheel is available. On some platforms missing wheel may cause compilation issues for the C extension.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Encode the string to bytes: data = data_str.encode('latin-1') or open file in binary mode 'rb'.","cause":"Passing a string instead of bytes to RTCMReader.","error":"TypeError: a bytes-like object is required, not 'str'"},{"fix":"Ensure the data is a valid RTCM3 stream starting with 0xD3. Use RTCMReader with proper bytes input.","cause":"Malformed RTCM data or incomplete stream (e.g., missing sync byte).","error":"pyrtcm.exceptions.RTCMStreamError: something went wrong"},{"fix":"Upgrade to latest version: pip install --upgrade pyrtcm. Check import path: from pyrtcm import RTCMReader.","cause":"Older version of pyrtcm (<1.0) may have different API. Or installed package is incomplete.","error":"ImportError: cannot import name 'RTCMReader'"},{"fix":"Always check if parsed is not None before accessing attributes.","cause":"Attempting to access parsed message attributes when parsed is None (parsing failed).","error":"AttributeError: 'NoneType' object has no attribute 'identity'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}