skillfed

canmatrix

canmatrix v1.2 1.2M downloads/30d#4,171 on PyPI1,086
Permissive license BSD Active released

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 canmatrix

uv

uv add canmatrix

poetry

poetry add canmatrix

Installing 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

Development Status :: 4 - BetaEnvironment :: ConsoleLicense :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering

Tags

CAN bus database parserdbc file converterCAN matrix format conversionautomotive CAN toolsCAN database manipulation
automotivecan-busprotocol-parsing

More Scientific/Engineering packages