candycan

Python CAN Application Wrapper

Designed by Bard

Features:

It’s based on Python-CAN, Scapy, cantools and dbc-editor

Install

Install all the dependencies listed in can-env.yaml and then install candycan

pip install candycan

CCP

  • on physical CAN device (Kvaser) with Scapy application interface
  • on physical CAN device with Python-CAN and CCP logic
  • context manager for CCP functions
  • CCP/XCP data codecs and data processing in Numpy array
  • Bytes codecs (raw binary, hex, numeric) with endianess handling
  • Flexible arguments setting with argparse and interactive InquirerPy
  • Encapsulation of CAN specs in unified Pydantic models (serialization, schema, validation, annotation, etc.)
  • Self incremental command counter inside CAN specs object
  • Type systems for CAN (native SocketCAN, Python-CAN) and bus (SocketCAN, virtual CAN, Kvaser, Vector, etc.)

A2L

  • a2l checking and fixing with pya2l and a2ltool
  • conversion a2l file to legit json files
  • al2 tree node, path and path segment definitions for positioning semantics
  • searching of calibration terms
  • Calibration object with dynamic properties for easy access of class attributes
  • Cached properties for automatic data conversion and derivative properties like data size for corresponding data type
  • Exception handling with missing calibration properties
  • Unified processing of measurement, axis, conversion method and data layouts
  • Lazy loading and streaming json file processing with events based ijson
  • Encapsulation of calibration properties and values in Pydantic objects (automatic validation, serialization, schemes, etc.)
  • Type systems for CCP/XCP data types
  • XCPConfig for CCP/XCP configuration
  • XCPData for encapsulating calibration data with automatic dimension, data size validation, automatic codecs of hex, raw and numeric values
  • array view of table data as cached property with automatic type conversion and validation
  • Create calibration data object from a2l file
  • Get calibration data from downloaded json file

DBC

  • load dbc files with cantools
  • append new messages and signals to dbc files
  • GUI for interactively modifying dbc on the command line with dbc-editor

XCP (tbd)