Python SDK
Python gRPC client with API shape consistent with the C API.
Installation
pip install grpcio protobuf
Quickstart
from tijet_grpc import TinCore
with TinCore() as client:
client.connect()
client.set_parameter("print_speed", "100")
speed = client.get_parameter("print_speed")
print(f"print_speed = {speed}")
checksum = client.set_print_data(b"\x1B\x40", index=0)
print(f"SHA-256: {checksum}")
Exception Hierarchy
$$TiJetError (base, code attribute)
├── InvalidArgumentError (code = -1)
├── NotConnectedError (code = -2)
├── TimeoutError (code = -3)
├── ServerError (code = -5)
└── InternalError (code = -6)$$
Note: For the complete Python API reference including event/log subscription and type aliases, see the Chinese documentation.