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 Common errors
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. Warnings
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`.
Imports
- ULog wrong
from pyulog.ulog import ULogcorrectfrom pyulog import ULog - messages wrong
from pyulog.messages import messagescorrectfrom pyulog import ULog
Quickstart
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")