Skip to content

About

Python module for parsing EFI Analytics TunerStudio logs for Megasquirt

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

py-ts-logs

Python library for parsing EFI Analytics TunerStudio MLG binary log files for Megasquirt.

Installation

pip install py-ts-logs

Usage

import ts_logs

# From a file path
result = ts_logs.parse("path/to/log.mlg")

# From raw bytes
with open("path/to/log.mlg", "rb") as f:
    data = f.read()
result = ts_logs.parse(data)

Return value

parse() returns a ParseResult TypedDict with the following keys:

Key Type Description
file_format str Magic string – always "MLVLG"
format_version int Format version (1 or 2)
timestamp datetime UTC timestamp embedded in the log header
info str Free-text info section (may be empty)
bit_field_names str Packed bit-field name strings
fields Dict[str, LoggerField] Channel/field definitions keyed by field name
record_length int Length of a single data record in bytes
records List[Dict[str, ...]] Parsed data records; each dict contains the channel name as key and raw integer/float value as value, plus block_type and relative_timestamp

LoggerField is a union of LoggerFieldScalar and LoggerFieldBit, both of which are TypedDicts.

Format

The file format parsed is the MLVLG (MegaLogViewer Log) binary format, versions 1 and 2, as documented in the EFI Analytics specification.

All fields in the binary file are encoded in big-endian byte order.

Development

pip install -e ".[dev]"
pytest

About

Python module for parsing EFI Analytics TunerStudio logs for Megasquirt

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages