pyulog

raw JSON →
1.2.2 verified Mon Apr 27 auth: no python

Python ULog parser and analysis library for PX4/ArduPilot logs. Current version 1.2.2, maintained by the PX4 project. Releases are irregular, roughly a few times a year.

pip install pyulog
error ModuleNotFoundError: No module named 'pyulog.ulog'
cause Direct import of submodule when using pyulog >=1.0.
fix
Use from pyulog import ULog instead.
error AttributeError: 'ULog' object has no attribute 'messages'
cause `messages` was a class attribute in older versions, removed in v1.2.0.
fix
Access messages via log.data_list; each element is a (topic, messages_list) tuple.
gotcha The ULog constructor does not read the entire file until you access data. Large files may cause high memory usage.
fix Use the iterative API (e.g., `log.chunks` or `log.message_iterator`) to process data in chunks.
breaking In v1.0, the public API changed: `ULog` is no longer importable from `pyulog.ulog`. Use `from pyulog import ULog`.
fix Update imports to `from pyulog import ULog`.
deprecated `pyulog.messages` submodule is deprecated since v1.2.0. Use `log.data_list` to access messages.
fix Replace `messages` imports with iteration over `ULog.data_list`.

Basic usage: read a .ulg file and iterate over topics.

from pyulog import ULog

# Parse a ULog file
log = ULog('sample.ulg')
# Access data
for topic, msg_list in log.data_list:
    print(f"Topic: {topic.name}, {len(msg_list)} messages")