Skip to main content

Async client for NanoKVM devices.

Project description

python-nanokvm

Async Python client for NanoKVM.

Usage

from nanokvm.client import NanoKVMClient
from nanokvm.models import GpioType, MouseButton

async with NanoKVMClient("http://kvm-8b76.local/api/") as client:
    await client.authenticate("username", "password")

    # Get device information
    dev = await client.get_info()
    hw = await client.get_hardware()
    gpio = await client.get_gpio()

    # List available images
    images = await client.get_images()

    # Keyboard input
    await client.paste_text("Hello\nworld!")

    # Mouse control
    await client.mouse_click(MouseButton.LEFT, 0.5, 0.5)
    await client.mouse_move_abs(0.25, 0.75)
    await client.mouse_scroll(0, -3)

    # Stream video
    async for frame in client.mjpeg_stream():
        print(frame)

    # Control GPIO
    await client.push_button(GpioType.POWER, duration_ms=1000)

SSH Usage

from nanokvm.ssh_client import NanoKVMSSH

# Create SSH client
ssh = NanoKVMSSH("kvm-8b76.local")
await ssh.authenticate("password")

# Run commands
uptime = await ssh.run_command("cat /proc/uptime")
disk = await ssh.run_command("df -h /")

await ssh.disconnect()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nanokvm-0.3.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nanokvm-0.3.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file nanokvm-0.3.0.tar.gz.

File metadata

  • Download URL: nanokvm-0.3.0.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nanokvm-0.3.0.tar.gz
Algorithm Hash digest
SHA256 bec41afe2bc397fd09e2a189a9128b90442e64f5571b47b9e60687e5d151d134
MD5 4d4817b23a5c8a2a0386da18430cb082
BLAKE2b-256 7623a50fda58ca3b04242c215cb6c08c60ec292c86cc6d048897da496c914c59

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanokvm-0.3.0.tar.gz:

Publisher: publish-to-pypi.yml on puddly/python-nanokvm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanokvm-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: nanokvm-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nanokvm-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f7a3e44991ff3b0175ff1d21cf1a73f12dd54cf8b583493b66352048e947c92
MD5 a6337f1fbedcc043224ce452be43604a
BLAKE2b-256 f8a9a28eadf01334bf8f4003b7daf7af4d8f42fe20958b87232cb2cdb6324024

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanokvm-0.3.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on puddly/python-nanokvm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page