Python#
This page covers using the kRPC Python client with the KSA service. The
kRPC Python client guide covers the client in full.
Note
kRPC for KSA is experimental, and the client package does not yet include type stubs for
the KSA service, so a type checker reports its members as unknown. A later release will
add them.
Installing#
Install the kRPC Python client from PyPI:
pip install krpc==0.7.0
The kRPC Python client guide covers other ways to install the client.
Connecting to the Server#
The client builds the KSA service from the definitions the server sends when it connects,
so the service is conn.ksa:
import krpc
conn = krpc.connect(name="Example")
vehicle = conn.ksa.active_vehicle
print(vehicle.name, vehicle.flight.mean_altitude)
The kRPC Python client guide covers connecting, streams, events and the client’s other features.