--- id: python-can version: "4.6.1" license: LGPL-3.0-only license_treatment: copyleft maintenance: active --- # python-can — Controller Area Network interface module for Python License: copyleft · Maintenance: active · Downloads: 5.2M/mo ## What it is and what it does python-can is a library that abstracts CAN bus communication for Python developers, allowing them to send and receive messages on Controller Area Network interfaces used in automotive, industrial, and embedded systems. It provides a unified API across multiple hardware backends and operating systems (Linux, macOS, Windows), handling the low-level details of different CAN controllers and protocols. The library supports standard and extended arbitration IDs, CAN FD (flexible data rate), message filtering, and multiple logging formats (ASC, BLF, MF4, CSV, SQLite). It includes command-line tools for bus inspection and a notifier system for asynchronous message handling. With active maintenance, broad platform support, and a stable API, it serves as the primary Python interface for CAN bus work in automotive and embedded applications. Use it for: - Develop automotive diagnostic tools or vehicle telemetry systems that read CAN messages from car networks. - Log and replay CAN bus traffic for testing and debugging embedded systems in manufacturing or robotics. - Build real-time monitoring dashboards for industrial equipment or wheelchairs that communicate over CAN. - Integrate CAN communication into Python-based control systems for boats, trucks, or other vehicles. - Automate testing of CAN-based hardware by sending and validating message sequences. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Python abstractions and utilities for Controller Area Network (CAN) communication, supporting multiple hardware backends and message logging formats. Yes. python-can is a mature, actively maintained library with low install friction, no known vulnerabilities, and broad hardware support. The LGPL-3.0 copyleft license requires derivative works to be open-source, which is a constraint for proprietary applications but standard for embedded systems work. Install it if you need to communicate with CAN buses from Python. ## Install pip install python-can uv add python-can poetry add python-can ## Installing python-can Before you install: Low install friction with three lightweight runtime dependencies (wrapt, packaging, typing_extensions). Active maintenance with recent commits and a stable production release cycle. License in practice: Licensed under LGPL-3.0-only (copyleft). Derivative works and modifications must be distributed under the same license; proprietary applications linking this library may face licensing constraints. Quickstart: pip install python-can import can with can.Bus(interface='socketcan', channel='vcan0') as bus: message = can.Message(arbitration_id=123, data=[0x11, 0x22, 0x33]) bus.send(message) for msg in bus: print(f"{msg.arbitration_id:X}: {msg.data}") Requires Python 3.9 or later. Hardware interface availability depends on the target platform (socketcan on Linux, PCAN on Windows, etc.) and installed drivers. Verify before relying: - Whether all advertised backends (socketcan, PCAN, Vector, Kvaser, etc.) are equally well-maintained and tested in version 4.6.1. - Performance characteristics and latency guarantees for real-time CAN communication on different platforms. - Compatibility with specific CAN hardware devices and whether driver installation is required beyond the Python package. ## Package facts - License: LGPL-3.0-only (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 5.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags CAN bus communication, controller area network Python, CAN message sending receiving, automotive CAN interface, CAN bus logging, embedded systems CAN, vehicle network communication, automotive, embedded-systems, hardware-interface [View on SkillFed](https://skillfed.io/packages/python-can) · [View on PyPI](https://pypi.org/project/python-can/)