Skip to main content

Library to control PiKVM with Python

Project description

PiKVM: A Python API for Controlling PiKVM Devices

PiKVM is a Python library that provides a simple and intuitive API for controlling PiKVM devices. With PiKVM, you can easily perform various actions on your PiKVM devices, such as:

  • Getting system information
  • Controlling ATX power
  • Managing Mass Storage Device (MSD) images
  • Interacting with General-Purpose Input/Output (GPIO) channels

With PiKVM, you can automate tasks, integrate PiKVMs into your existing applications, and extend the capabilities of your PiKVM devices.

Installation

To install PiKVM, simply run the following command in your terminal:

pip install pikvm-lib

Usage

After installing PiKVM, you can import it into your Python script and create an instance of the PiKVM class. The PiKVM class constructor takes the following parameters:

  • hostname: The hostname or IP address of the PiKVM device
  • username: The username for authentication
  • password: The password for authentication
from pikvm_lib import PiKVM

pikvm_instance = PiKVM(hostname="192.168.1.10", username="admin", password="password")

Once you have created an instance of the PiKVM class, you can use it to interact with your PiKVM device. For example, you can get the system information of the device:

system_info = pikvm_instance.get_system_info()
print(system_info)

You can also control the ATX power of the device:

pikvm_instance.set_atx_power(action="on")

For more information on how to use PiKVM, please refer to the official documentation: PiKVM official web and PiKVM API Reference

Examples

Here are some examples of how to use PiKVM to perform common tasks:

  • Getting system information:
from pikvm_lib import PiKVM

pikvm_instance = PiKVM(hostname="192.168.1.10", username="admin", password="password")
system_info = pikvm_instance.get_system_info()
print(system_info)
  • Turning on the ATX power:
pikvm_instance.set_atx_power(action="on")
  • Uploading an MSD image:
pikvm_instance.upload_msd_image(filepath="/path/to/image.iso")
  • Connecting the MSD:
pikvm_instance.connect_msd()
  • Switching a GPIO channel:
pikvm_instance.switch_gpio_channel(channel=1, state=1)

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

pikvm_lib-0.2.0.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

pikvm_lib-0.2.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file pikvm_lib-0.2.0.tar.gz.

File metadata

  • Download URL: pikvm_lib-0.2.0.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for pikvm_lib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b8c74e7d881d26849f8bfce9e6d68531cab565237b3b0d579fa2c56beef1d7e0
MD5 ece5cc3f8c377e4feaa2e0ae498320d6
BLAKE2b-256 cf8d4bac14f3ba8ba129c78870be1755aed063f87fd304acde6e446e9765480e

See more details on using hashes here.

File details

Details for the file pikvm_lib-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pikvm_lib-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for pikvm_lib-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81bf4e26f9ecf486cac737c10bf090bab0484d221c0e561c44b3d684b03aaed1
MD5 f94f65340c225b550eaeab651eee05da
BLAKE2b-256 66d92339a8f561cff0e1c6d11c95fd9a2ecc6434732f2b9c0c4e015bc92f4be0

See more details on using hashes here.

Supported by

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