Semantically compare two CAN .dbc database files
Project description
dbcdiff
A professional DBC file diff tool for automotive CAN bus development.
Compare two.dbcdatabases, detect what changed, and understand the impact — from the CLI or a modern dark-theme GUI.
Features
| Feature | Details |
|---|---|
| Breaking / Functional / Metadata severity classification | Instantly see what actually matters |
| Protocol detection | Auto-identifies J1939, CAN FD, CAN XL, or Basic CAN |
| File A / File B consistent terminology | No ambiguous "old / new" language |
| Three export formats | HTML (self-contained), CSV, JSON |
| PySide6 dark-theme GUI | Drag-and-drop files, filter by severity |
| CLI one-liner | Pipe-friendly, non-zero exit on changes |
Standalone .exe |
PyInstaller or Nuitka build — no Python required on target |
Installation
# From PyPI (when published)
pip install dbcdiff
# From source
git clone https://github.com/pawanct08/dbcdiff
cd dbcdiff
pip install -e ".[gui]" # includes PySide6
Dependencies
| Package | Purpose |
|---|---|
cantools>=41.0 |
DBC parsing |
PySide6>=6.5 |
GUI (optional — CLI works without it) |
Quick Start
CLI
# Basic diff (prints table, exits with severity code)
dbcdiff FileA.dbc FileB.dbc
# Export HTML report
dbcdiff FileA.dbc FileB.dbc --html report.html
# Export all formats
dbcdiff FileA.dbc FileB.dbc --html out.html --csv out.csv --json out.json
# Only show breaking changes; suppress table
dbcdiff FileA.dbc FileB.dbc --min-severity breaking -q --html breaking.html
Exit codes
| Code | Meaning |
|---|---|
0 |
Files are identical |
1 |
Metadata-only differences |
2 |
Functional differences |
3 |
Breaking differences |
Use in CI:
dbcdiff baseline.dbc candidate.dbc
if [ $? -ge 3 ]; then echo "BREAKING CHANGES – review required"; exit 1; fi
GUI
# Launch GUI (double-click exe, or run without arguments)
dbcdiff
# or
dbcdiff-gui
- Drag a
.dbcfile onto the File A drop zone (or click Browse). - Drag a
.dbcfile onto the File B drop zone. - Click Compare.
- Filter by severity using the toolbar buttons.
- Click Export HTML to save a shareable report.
Sample Output
CLI table
┌──────────────┬──────────┬────────────────────────────────────────┬
│ Severity │ Kind │ Path │
├──────────────┼──────────┼────────────────────────────────────────┼
│ BREAKING │ removed │ EngineControl.TorqueRequest │
│ BREAKING │ added │ EngineControl.TorqueRequestExt │
│ FUNCTIONAL │ changed │ EngineControl.EngineSpeed.factor │
│ FUNCTIONAL │ changed │ EngineControl.EngineSpeed.offset │
│ METADATA │ changed │ EngineControl.EngineSpeed.unit │
└──────────────┴──────────┴────────────────────────────────────────┘
Max severity: BREAKING | 5 change(s) | Protocol: J1939
HTML Report
The --html flag produces a self-contained HTML file (no external CSS or JS):
- Colour-coded severity rows
- Protocol badge and file header
- JavaScript filter buttons (All / Breaking / Functional / Metadata)
- Share or attach to pull request reviews
Building a Standalone .exe
Option A — PyInstaller (quick, ~60 MB)
pip install pyinstaller pillow
.\build\build_exe.ps1
# → dist\dbcdiff-gui.exe
Option B — Nuitka (native code, harder to decompile)
pip install nuitka ordered-set zstandard pillow
# + install Visual Studio Build Tools (or MinGW-w64)
.\build\build_protected.ps1
# → dist\dbcdiff-gui.exe
See build/ for full scripts and DESIGN.md for
architecture details.
Protocol Detection
dbcdiff automatically classifies the network from database heuristics:
| Protocol | Detection |
|---|---|
| CAN XL | is_fd + DLC > 64 bytes |
| CAN FD | is_fd flag on any message |
| J1939 | Extended 29-bit frame with non-zero PGN |
| Basic CAN | Default |
J1939 frames are decoded into Priority / PGN / SA fields for richer context.
Severity Reference
| Severity | Colour | Meaning |
|---|---|---|
BREAKING |
🔴 Red | Message/signal added or removed; ID or DLC changed |
FUNCTIONAL |
🟠 Orange | Factor, offset, range, byte order, value type changed |
METADATA |
🟢 Green | Comment, unit, or attribute changed |
IDENTICAL |
— | No differences found |
Project Layout
dbcdiff/
├── engine.py # Core diff algorithm
├── protocol.py # CAN protocol detection
├── cli.py # CLI interface
├── gui.py # PySide6 GUI
└── reporters/
├── html_reporter.py
├── csv_reporter.py
└── json_reporter.py
build/
├── create_icon.py # Generate icon.ico
├── build_exe.ps1 # PyInstaller build
└── build_protected.ps1 # Nuitka build
See DESIGN.md for full architecture documentation.
License
MIT © 2024 dbcdiff contributors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbcdiff-0.2.0.tar.gz.
File metadata
- Download URL: dbcdiff-0.2.0.tar.gz
- Upload date:
- Size: 44.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a80e80ad6842e3f10f3d577556661b426f73586256bacdb0bd25d44bbeb8cca
|
|
| MD5 |
d7fd3cfe3948edcc19eae958c521e8ce
|
|
| BLAKE2b-256 |
11b55d16d66fcc44169aacef05b176e7e3284e7984902a25e4d77baac8237b37
|
Provenance
The following attestation bundles were made for dbcdiff-0.2.0.tar.gz:
Publisher:
publish.yml on pawanct08/dbcdiff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbcdiff-0.2.0.tar.gz -
Subject digest:
5a80e80ad6842e3f10f3d577556661b426f73586256bacdb0bd25d44bbeb8cca - Sigstore transparency entry: 1328831945
- Sigstore integration time:
-
Permalink:
pawanct08/dbcdiff@ee102cb3a1a1abf0415e293098ab7b9c0829c444 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/pawanct08
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ee102cb3a1a1abf0415e293098ab7b9c0829c444 -
Trigger Event:
release
-
Statement type:
File details
Details for the file dbcdiff-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dbcdiff-0.2.0-py3-none-any.whl
- Upload date:
- Size: 39.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ef715b868cae6f30931a215c5f7e5fff4c905947bfc9734d0891d5993146fb2
|
|
| MD5 |
eaf48b663e6ccdc4070b7bbedb9201ca
|
|
| BLAKE2b-256 |
e76dd608a438dcb88f0e2def8861d8bb47896ffc84ec838e7c6641f000f1c043
|
Provenance
The following attestation bundles were made for dbcdiff-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on pawanct08/dbcdiff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbcdiff-0.2.0-py3-none-any.whl -
Subject digest:
1ef715b868cae6f30931a215c5f7e5fff4c905947bfc9734d0891d5993146fb2 - Sigstore transparency entry: 1328831963
- Sigstore integration time:
-
Permalink:
pawanct08/dbcdiff@ee102cb3a1a1abf0415e293098ab7b9c0829c444 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/pawanct08
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ee102cb3a1a1abf0415e293098ab7b9c0829c444 -
Trigger Event:
release
-
Statement type: