Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
.venv/
__pycache__/
*.pyc
*.pyo
*.pyd
*.pyw
*.pyz
.pytest_cache/
.ruff_cache/
.vscode/
.idea/
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
2 changes: 1 addition & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nanokvm API Reference

**Version:** 0.1.2
**Version:** 0.1.3
**License:** MIT
**Python:** >= 3.12

Expand Down
15 changes: 9 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
"""Quick CLI to list available NanoKVM devices and test connectivity."""

from nanokvm import SerialConnection, VideoCapture
from nanokvm._logger import get_logger

logger = get_logger(__name__)


def main() -> None:
print("=== Available Serial Ports ===")
logger.info("=== Available Serial Ports ===")
ports = SerialConnection.list_ports()
if ports:
for p in ports:
print(f" {p.device}: {p.description} [{p.hwid}]")
logger.info(f" {p.device}: {p.description} [{p.hwid}]")
else:
print(" (none found)")
logger.info(" (none found)")

print("\n=== Available Video Devices ===")
logger.info("\n=== Available Video Devices ===")
devices = VideoCapture.list_devices()
if devices:
for d in devices:
print(
logger.info(
f" Index {d['index']}: {d['width']}x{d['height']} @ {d['fps']}fps ({d['backend']})"
)
else:
print(" (none found)")
logger.info(" (none found)")


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion nanokvm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from .serial_conn import SerialConnection
from .video import VideoCapture

__version__ = "0.1.2"
__version__ = "0.1.3"

__all__ = [
"NanoKVM",
Expand Down
15 changes: 9 additions & 6 deletions nanokvm/__main__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
"""Quick CLI to list available NanoKVM devices and test connectivity."""

from nanokvm import SerialConnection, VideoCapture
from nanokvm._logger import get_logger

logger = get_logger(__name__)


def main() -> None:
print("=== Available Serial Ports ===")
logger.info("=== Available Serial Ports ===")
ports = SerialConnection.list_ports()
if ports:
for p in ports:
print(f" {p.device}: {p.description} [{p.hwid}]")
logger.info(f" {p.device}: {p.description} [{p.hwid}]")
else:
print(" (none found)")
logger.info(" (none found)")

print("\n=== Available Video Devices ===")
logger.info("\n=== Available Video Devices ===")
devices = VideoCapture.list_devices()
if devices:
for d in devices:
print(
logger.info(
f" Index {d['index']}: {d['width']}x{d['height']} @ {d['fps']}fps ({d['backend']})"
)
else:
print(" (none found)")
logger.info(" (none found)")


if __name__ == "__main__":
Expand Down
11 changes: 11 additions & 0 deletions nanokvm/_logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import logging


def get_logger(name: str) -> logging.Logger:
logger = logging.getLogger(name)
if not logger.handlers:
logging.basicConfig(
level=logging.INFO,
format="%(name)s: %(message)s",
)
return logger
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "nanokvm"
version = "0.1.2"
version = "0.1.3"
description = "Python library for controlling machines via NanoKVM-USB — serial HID + UVC video capture for AI agents"
readme = "README.md"
requires-python = ">=3.12"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.