canmatrix
What it is and what it does
Canmatrix is a Python library for working with CAN (Controller Area Network) bus database files, which describe automotive and industrial communication protocols. It models CAN communication as Python objects—Boardunits, Frames, Signals, Values—and provides tools to read, write, and convert between multiple database formats used by different vendors and tools.
The library supports import from nine file formats (.dbc, .dbf, .kcd, .arxml, .yaml, .xls, .sym, .xml, .ldf, .odx) and export to eight (.dbc, .dbf, .kcd, .xls, .json, .arxml, .yaml, .sym, .xml, .lua, .scapy). It also includes command-line tools (canconvert, cancompare) for batch conversion and comparison, plus extract and merge operations for database manipulation.
Use it for:
- Convert CAN database files between vendor formats for tool interoperability
- Parse and programmatically inspect CAN frame and signal definitions from automotive database files
- Generate Wireshark Lua scripts or Scapy packet definitions from CAN database metadata
- Compare two CAN database versions to identify changes in frames, signals, or message definitions
- Extract subsets of a CAN database or merge multiple databases for modular vehicle projects
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Canmatrix parses, manipulates, and converts CAN bus database files between multiple formats (.dbc, .dbf, .kcd, .arxml, .yaml, .xls, .sym, .xml, .ldf, .odx) and exports to formats including .json, .lua, and .scapy.
Yes. Canmatrix is actively maintained, has no known vulnerabilities, installs with low friction, and is the standard tool for CAN database format conversion in Python. Install it if you work with automotive CAN protocols, need to translate between vendor database formats, or want to programmatically inspect CAN message definitions.
Install
canmatrix on PyPI
pip
pip install canmatrixuv
uv add canmatrixpoetry
poetry add canmatrixInstalling canmatrix
Before you install
Low friction: pure Python wheel with four lightweight runtime dependencies (attrs, click, typing, importlib-metadata). Actively maintained with recent commits and no known vulnerabilities.
License in practice
BSD permissive license allows commercial and private use with minimal restrictions; suitable for most projects without legal friction.
Quickstart
pip install canmatrix
import canmatrix
db = canmatrix.load('example.dbc')
db.save('output.json')
Verify before relying
- Whether the package supports Python versions listed in classifiers (3.4–3.11) or only modern versions in practice
- Whether arxml export is production-ready or remains basic as documented
- Exact API for loading and saving CAN database files programmatically
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — attrs, click, typing, importlib-metadata |
| Maintenance | actively maintained — 543 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,241,586/month — #4,171 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: canmatrix-1.2-py3-none-any.whl
Keywords: CAN, dbc, arxml, kcd, dbf, sym
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
asammdfasammdf parses, edits, and exports ASAM MDF…
copyleft · top 5,000 on PyPI
cantoolsCantools parses automotive CAN bus database…
permissive · top 5,000 on PyPI
odxtoolsodxtools parses and processes ODX (Open…
permissive · top 5,000 on PyPI
tablibTablib converts tabular data between multiple…
permissive · top 5,000 on PyPI
ldfparserParses LIN Description Files (LDF) to extract…
permissive · top 5,000 on PyPI
dbfReads and writes dBase III, FoxPro, Visual…
permissive · top 15,000 on PyPI
xls2xlsxConverts legacy Excel files (.xls), HTML…
permissive · top 5,000 on PyPI
dbfreadReads DBF database files (dBase, Visual FoxPro,…
permissive · top 5,000 on PyPI
csvkitcsvkit provides command-line tools for…
permissive · top 15,000 on PyPI
autosar-dataPython bindings for reading, writing, and…
unclear · top 15,000 on PyPI