// the find
semuconsulting/pyubx2
Python library for parsing and generating UBX GPS/GNSS protocol messages.
pyubx2 is a Python library for parsing and generating UBX binary messages used by u-blox GNSS receivers, with bonus support for NMEA and RTCM3 via sibling packages. It covers both reading from live serial/socket streams and constructing commands to send to a receiver. The target audience is embedded/hardware developers working with u-blox GPS modules who want something above the raw byte level.
The protocol coverage is thorough — GET, SET, and POLL modes are all handled, and the Generation 9 CFG-VALSET/VALDEL/VALGET configuration database interface is a real differentiator since most alternatives ignore it. The message type system is dictionary-driven and explicitly extensible, so adding undocumented or proprietary message variants doesn't require forking the library. The UBXReader iterator pattern works cleanly over serial, file, or socket streams with a consistent API. Test coverage is good — there are dedicated log files for every major message class and edge case, suggesting the parser has been fuzz-tested against real hardware output.
The library is pure parsing with no higher-level abstractions — you get bytes-in/objects-out but there's no built-in async support, no connection management, and no ready-made pattern for sending a command and waiting for its ACK-ACK response (the ubxpoller.py example shows the pattern but you have to wire it yourself). Repeating group access is awkward: you need getattr(msg, f'svid_{i+1:02d}') with a manual loop, which is clunky compared to just getting a list. The library also depends on pynmeagps and pyrtcm for multi-protocol support, which means three packages to keep in sync — a risk if u-blox firmware updates push one package ahead of the others. Documentation lives in Sphinx but the README is already long; finding which attributes exist on a given message type requires either running the code or reading the ubxtypes_*.py dictionaries directly.