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 deviceusername
: The username for authenticationpassword
: The password for authentication
from pikvm_lib import pikvm
pikvm_instance = pikvm.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.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
Built Distribution
File details
Details for the file pikvm_lib-0.1.4.tar.gz
.
File metadata
- Download URL: pikvm_lib-0.1.4.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a9b61cd28e6d4ac628c01c53af4a4f8feda5062bda0a3d1e5b9e7bdcdb36d50 |
|
MD5 | 14da8d07f38540da78c3f649d269c6e9 |
|
BLAKE2b-256 | 31ac7b7f9291a0371531ffba099ddecd3ee24002d5704e9eb5792bdc5b080831 |
File details
Details for the file pikvm_lib-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: pikvm_lib-0.1.4-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d85eee1cccb046e3281d43e471d93e9d9d58fd7fd8df16d1691dfd641386f39 |
|
MD5 | e47f7e74d01091093faac1fd581e9861 |
|
BLAKE2b-256 | 0f45a6dd9caffe0cdf63536cb0874d9cf69593240335cceccf6d7e830a5e3e49 |