Skip to main content

GKBus

High level automotive protocol library

from gkbus.device import Bus, discover
from gkbus.protocol import kwp2000
from gkbus.transport import Kwp2000OverKLineTransport

print('available devices')
for device in discover():
	print(f'    {device.description()}')

device = discover({Bus.KLINE})[0] # or find_device('/dev/ttyUSB0')
channel = device.kline() # for CAN: device.canbus() and Kwp2000OverCanTransport
transport = Kwp2000OverKLineTransport(channel, tx_id=0x11, rx_id=0xf1)
kwp = kwp2000.Kwp2000Protocol(transport)

print('fast init')
init_success = kwp.init(kwp2000.commands.StartCommunication())
print('fast init : {}'.format(init_success))

print('requesting security access seed')
response = kwp.execute(kwp2000.commands.SecurityAccess().request_seed())
print(response.get_data())

print('starting flash reprogramming diagnostic session')
response = kwp.execute(
	kwp2000.commands.StartDiagnosticSession(
		kwp2000.enums.DiagnosticSession.FLASH_REPROGRAMMING
		)
	)
print(response)

kwp.close()

Layers

  • Device - the physical adapter (KKL cable, SocketCAN interface, PCAN, ...). Find them with discover(), or create one from a port name with find_device()
  • Channel - one bus on a device, device.kline() or device.canbus(). Reads and writes bytes (K-Line) or frames (CAN)
  • Transport - turns protocol PDUs into what goes over the channel (K-Line framing, ISO-TP). Opens the channel if it isn't open yet and then closes it too - a channel you opened yourself stays open, so you can hand it from one transport to the next
  • Protocol - KWP2000, CCP

Supported protocols

  • Kwp2000 (ISO14230) - over CAN and K-Line

  • CCP (Can Calibration Protocol)

Installing

GKBus is available on PyPi:

$ python -m pip install gkbus

API Reference available on Read the Docs

Metadata

Release files for gkbus 0.5.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gkbus 0.5.11
File Size Uploaded Provenance Actions
gkbus-0.5.11.tar.gz 48.6 kB With provenance Details for gkbus-0.5.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gkbus 0.5.11
File Interpreter ABI Platform Actions
gkbus-0.5.11-py3-none-any.whl Python 3 none any Details for gkbus-0.5.11-py3-none-any.whl

Total release size: 113.1 kB

Release files / gkbus-0.5.11.tar.gz

Download URL gkbus-0.5.11.tar.gz
Size 48.6 kB
Tags Source
SHA-256 checksum
How to use checksums
99be4c68b0eecdf4d433f59c3b9781500834c8f79725e09262954d4283f533f0
BLAKE2b-256 checksum
How to use checksums
0d7d5c798b370ea57464cfe1f13b0347279f3103b0d72712924bc5a0202293ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / gkbus-0.5.11-py3-none-any.whl

Download URL gkbus-0.5.11-py3-none-any.whl
Size 64.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d873797d538a510725fbd57b6040ff965b870cf484e79d0875bf479fdfa80d8
BLAKE2b-256 checksum
How to use checksums
ff448f00cf611e5357b3625a006664d40b327e9aad047296333d5b8007461098
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for gkbus 0.5.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gkbus-0.5.11.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.11 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page