Metadata-Version: 2.4
Name: nanokvm
Version: 0.0.2
Summary: Async client for NanoKVM devices.
Author-email: puddly <puddly3@gmail.com>
License: Apache-2.0
Project-URL: repository, https://github.com/puddly/python-nanokvm
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp
Requires-Dist: cryptography
Requires-Dist: yarl
Requires-Dist: pillow
Requires-Dist: pydantic
Provides-Extra: testing
Requires-Dist: tomli; extra == "testing"
Requires-Dist: coverage[toml]; extra == "testing"
Requires-Dist: pytest; extra == "testing"
Requires-Dist: pytest-xdist; extra == "testing"
Requires-Dist: pytest-asyncio; extra == "testing"
Requires-Dist: pytest-cov; extra == "testing"
Requires-Dist: pytest-timeout; extra == "testing"
Requires-Dist: aioresponses; extra == "testing"
Dynamic: license-file

# python-nanokvm

Async Python client for [NanoKVM](https://github.com/sipeed/NanoKVM).

## Usage

```python

from aiohttp import ClientSession
from nanokvm.models import ButtonType
from nanokvm.client import NanoKVMClient


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

    dev = await client.get_info()
    hw = await client.get_hardware()
    gpio = await client.get_gpio()

    await client.paste_text("Hello\nworld!")

    async for frame in client.mjpeg_stream():
        print(frame)

    await client.push_button(ButtonType.POWER, duration_ms=1000)
```
