pycan-plot
Graph CAN signals from a recorded candump log, decoded through a KCD
database.
Installation
pip install -e .
Usage
pycan-plot capture.log -d database.kcd -s Status.Voltage -s Status.Mode -o plot.png
Signals are named Message.Signal, exactly as they appear in the KCD.
With no -o, an interactive window opens instead.
| Option | Meaning |
|---|---|
-d, --kcd |
KCD database (required) |
-s, --signal |
Message.Signal to plot; repeatable |
-p, --prefix |
Hex stack-position prefix ORed onto each message ID (default 0x0) |
-t, --time-window |
START..END; each end is relative seconds (12.5) or a clock time (08:25:40), and either may be omitted |
-o, --output |
Output file; format taken from the extension (.png, .svg, .pdf) |
--show |
Open an interactive window; implied when -o is absent |
--split |
One subplot per signal instead of overlaying them |
--line |
Interpolate between samples instead of holding each value |
Signals are drawn as steps by default, because a CAN signal holds its last
received value until the next frame arrives. --line overrides that.
Examples:
# One module in stack position 2, clipped to twenty seconds of the capture
pycan-plot capture.log -d db.kcd -s Status.Voltage -p 0x02000000 -t 10..30 -o v.png
# Two signals on separate stacked axes, clipped by wall-clock time
pycan-plot capture.log -d db.kcd -s Status.Voltage -s Status.Mode \
--split -t 08:25:40..08:26:10 -o both.svg
Exit codes
| Code | Meaning |
|---|---|
| 0 | success |
| 1 | log, KCD, or output file could not be read or written |
| 2 | CLI usage error (unknown message or signal, bad -t, bad -p) |
| 3 | no samples found for any requested signal |
Exit code 3 reports which stack-position prefixes were present for the
requested messages — usually the fastest way to spot a wrong -p.
Fish tab completion
An editable install writes the completion script automatically. To do it by hand:
_PYCAN_PLOT_COMPLETE=fish_source pycan-plot | source # current shell
_PYCAN_PLOT_COMPLETE=fish_source pycan-plot > ~/.config/fish/completions/pycan-plot.fish # persistent
Completion covers log files, KCD files, message and signal names pulled live from the KCD on the command line, and — once the log file is given — the stack-position prefixes actually present in that log.
License
pycan-plot is distributed under the terms of the GPL-3.0-or-later license.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pycan_plot-0.0.1.tar.gz.
File metadata
- Download URL: pycan_plot-0.0.1.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f46cbce03ca637a670d183813176c6e44896d45b51173b3ebced43a64e95b19
|
|
| MD5 |
5b5f561e0b1183427d657726e94c6df9
|
|
| BLAKE2b-256 |
d825af40762fb592d15540259fbecf69eb7613fa9ae3ac6ea58274e5b386f3bf
|