python-can is a python library that allows you to easily communicate on the CAN bus from Python.

Windows and Linux and OSX:

Windows and Linux: The library supports connecting to CANWork devices directly with via a serial connection on Windows or Linux and also can directly work with socketcan devices on Linux with the candlelight firmware.

Documentation on python-can is available here.

The library is cross-platform and can connect directly to a CANable’s virtual serial port interface or native socketcan interface. With only a couple lines of code you can decode traffic on the bus, send messages, and more.