A cross-platform visual application to compare two versions of CAN DBC database files and generate comparison reports in Excel, HTML, and PDF formats with categorized change sheets.
Runs on Windows, macOS, and Linux.
- Visual GUI — browse folders, click Compare, view results
- CLI mode — scriptable command-line interface for automation
- Cross-platform — standalone executables for Windows (.exe), macOS (.app), Linux
- Parses
.dbcfiles (Vector CANdb++ format) - Compares all messages and signals side-by-side
- Covers every DBC attribute (37 columns per side)
- Multi-format output — Excel (.xlsx), HTML, and PDF per bus
- 8-sheet Excel with categorized changes:
- Comparison Summary dashboard
- New / Removed / Modified Messages
- New / Removed / Modified Signals
- Full Comparison (flat side-by-side)
- HTML report — standalone, responsive, opens in any browser
- PDF report — print-ready landscape document with all sections
- Color-coded differences (pink for changed cells, green tint for context)
- Professional styling with dark header theme and alternating row shading
- Automatically matches DBC files by bus name across folders
Run with Python:
pip install openpyxl fpdf2
python3 dbc_compare_gui.pyOr build a standalone executable (no Python needed to run):
| Platform | Build Command | Output |
|---|---|---|
| Windows | build_windows.bat |
dist\dbc_compare_gui.exe |
| macOS | ./build.sh |
dist/dbc_compare_gui.app |
| Linux | ./build.sh |
dist/dbc_compare_gui |
Then just double-click the executable to launch.
pip install openpyxl fpdf2
python3 dbc_compare.py <old_folder> <new_folder>- Launch the application (double-click the executable or run
python3 dbc_compare_gui.py) - Click Browse to select the Old Version folder containing DBC files
- Click Browse to select the New Version folder containing DBC files
- (Optional) Set a custom Output Folder, or leave empty for auto-naming
- Click Compare
- View the results summary table showing differences per bus
- Click Open Output Folder to access the generated Excel files
python3 dbc_compare.py <old_folder> <new_folder> [--output <output_folder>]
Example:
python3 dbc_compare.py old_version_folder new_version_folderOutput:
SUMMARY
============================================================
Bus Total Rows Differences
--------------- ------------ -------------
CAN_CH1 5160 1309
CAN_CH2 2281 643
CAN_CH3 1988 945
...
TOTAL 14826 4983
Each generated .xlsx file contains 8 sheets for comprehensive change analysis:
Overview statistics showing total message counts and categorized change counts.
| Metric | Example |
|---|---|
| Total Messages in Old Version | 256 |
| Total Messages in New Version | 257 |
| New Messages | 1 |
| Removed Messages | 0 |
| Modified Messages | 10 |
| New Signals | 35 |
| Removed Signals | 16 |
| Modified Signals | 44 |
Messages that exist only in the new or old version (8 columns):
Message ID | Message Name | Message Length | Signals | Send Type | Cycle Time | Tx ECU | Rx ECUs
Side-by-side comparison of messages with changes (8 fields x 2 versions = 16 columns). Red-highlighted cells indicate which fields changed.
Signals that exist only in the new or old version (12 columns):
Message ID | Message Name | Signal Name | Start Bit | Length | Initial | Minimum | Maximum | Unit | Factor | Value Table | Receivers
3 fixed identifier columns + 9 paired old/new attribute columns (21 columns total). Red-highlighted cells indicate which attributes changed.
Comprehensive flat side-by-side table with all 37 attributes per side (74 columns total), covering every DBC attribute.
| Column | DBC Source | Description |
|---|---|---|
| Id | BO_ | Message ID (hex) |
| Name | BO_ / SystemMessageLongSymbol | Message name |
| SendType | GenMsgSendType | Cyclic, IfActive, etc. |
| CycleTime | GenMsgCycleTime | Normal cycle time (ms) |
| CycleTimeFast | GenMsgCycleTimeFast | Fast cycle time (ms) |
| CycleTimeActive | GenMsgCycleTimeActive | Active cycle time (ms) |
| NrOfRepetition | GenMsgNrOfRepetition | Repetition count |
| DelayTime | GenMsgDelayTime | Delay time (ms) |
| StartDelayTime | GenMsgStartDelayTime | Start delay time (ms) |
| Dlc | BO_ | Data length code |
| VFrameFormat | VFrameFormat | StandardCAN / CAN_FD |
| CANFD_BRS | CANFD_BRS | Bit rate switch |
| Transmitter | BO_ | Transmitting node |
| ILSupport | GenMsgILSupport | Interaction layer support |
| NmMessage | NmMessage | Network management flag |
| DiagRequest | DiagRequest | Diagnostic request |
| DiagResponse | DiagResponse | Diagnostic response |
| DiagState | DiagState | Diagnostic state |
| MsgComment | CM_ BO_ | Message comment |
| Column | DBC Source | Description |
|---|---|---|
| Name | SG_ / SystemSignalLongSymbol | Signal name |
| Start | SG_ | Start bit (natural position) |
| Length | SG_ | Bit length |
| Endian | SG_ @0/@1 | big (Motorola) / little (Intel) |
| Signed | SG_ +/- | unsigned / signed |
| Scale | SG_ factor | Scale factor |
| Offset | SG_ offset | Offset value |
| Min | SG_ min | Minimum physical value |
| Max | SG_ max | Maximum physical value |
| Unit | SG_ unit | Unit string |
| InvalidValue | BA_ InvalidValue | Signal invalid value (e.g. "FFh") |
| StartValue | BA_ GenSigStartValue | Initial / failsafe value |
| InactiveValue | BA_ GenSigInactiveValue | Inactive value |
| SendType | BA_ GenSigSendType | Signal send type |
| TimeoutTime | BA_ GenSigTimeoutTime_ALL | Timeout time (ms) |
| ValueDesc | VAL_ | Value descriptions (e.g. "0: Off, 1: On") |
| Comment | CM_ SG_ | Signal comment |
| Receivers | SG_ receivers | Receiver node list |
| Color | Meaning |
|---|---|
| Light Green (E2EFDA) | Row has differences — unchanged cells provide context |
| Pink (FFC7CE) | Specific cell that changed |
| Light Gray (F2F2F2) | Alternating row shading for readability |
| Dark Blue Header (1F4E79) | Column headers with white text |
| No color | Row is identical between versions |
- Python 3.7+
- pip
build_windows.batProduces:
dist\dbc_compare_gui.exe— GUI app (double-click)dist\dbc_compare.exe— CLI tool
chmod +x build.sh
./build.shProduces:
dist/dbc_compare_gui.app— GUI app (double-click)dist/dbc_compare— CLI tool
# Install tkinter if not present
sudo apt-get install python3-tk
chmod +x build.sh
./build.shProduces:
dist/dbc_compare_gui— GUI appdist/dbc_compare— CLI tool
The tool matches old vs new DBC files by bus prefix extracted from filenames:
<number>_<BUS_NAME>_<rest_of_filename>.dbc
Examples:
01_CAN_CH1_Project_v1.0.dbc→ bus prefix:01_CAN_CH102_CAN_CH2_Project_v2.0.dbc→ bus prefix:02_CAN_CH2
Files with matching bus prefixes are compared automatically.
dbc-compare-tool/
dbc_compare_gui.py # GUI application source
dbc_compare.py # Core comparison engine + CLI
requirements.txt # Python dependencies
build.sh # Build script (macOS/Linux)
build_windows.bat # Build script (Windows)
CHECKSUM.sha256 # Author verification hash
README.md
LICENSE
- Python 3.7+
- openpyxl — Excel file generation
- fpdf2 — PDF report generation
- tkinter — GUI (included with Python on Windows/macOS;
sudo apt install python3-tkon Linux) - PyInstaller — only needed for building standalone executables
MIT License
