Async Python client for the Sipeed NanoKVM and NanoKVM Pro.
pip install nanokvmimport asyncio
from nanokvm.client import NanoKVMClient
from nanokvm.models import GpioType, MouseButton
async def main() -> None:
async with NanoKVMClient("https://kvm.local/api/") as client:
await client.authenticate("username", "password")
await client.push_button(GpioType.POWER, duration_ms=1000)
await client.paste_text("Hello\nworld!")
await client.mouse_click(MouseButton.LEFT, 0.5, 0.5)
async for frame in client.mjpeg_stream():
frame.save("screen.jpg")
break
asyncio.run(main())The client detects the hardware and firmware, and raises
NanoKVMNotSupportedError instead of calling an endpoint the device lacks.
- Connecting and authentication: HTTPS and self-signed certificates, sessions, passwords and user accounts
- API reference: every method and the hardware and firmware it needs
- Errors
- SSH