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.
Scripts that do not use asyncio can use the same API as blocking calls through
nanokvm.sync_client.NanoKVMSyncClient.
- Connecting and authentication: HTTPS and self-signed certificates, sessions, passwords and user accounts
- API reference: every method and the hardware and firmware it needs
- Blocking client: the API without asyncio
- Errors
- SSH