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
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 = 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.get_system_info()
print(system_info)
You can also control the ATX power of the device:
pikvm.set_atx_power(action="on")
For more information on how to use PiKVM, please refer to the official documentation: https://docs.pikvm.org/: https://docs.pikvm.org/
Examples
Here are some examples of how to use PiKVM to perform common tasks:
- Getting system information:
from pikvm_lib import pikvm
pikvm = pikvm.PiKVM(hostname="192.168.1.10", username="admin", password="password")
system_info = pikvm.get_system_info()
print(system_info)
- Turning on the ATX power:
pikvm.set_atx_power(action="on")
- Uploading an MSD image:
pikvm.upload_msd_image(filepath="/path/to/image.iso")
- Connecting the MSD:
pikvm.connect_msd()
- Switching a GPIO channel:
pikvm.switch_gpio_channel(channel=1, state=1)
Conclusion
PiKVM is a powerful and versatile library that makes it easy to control PiKVM devices from Python scripts. With PiKVM, you can automate tasks, integrate PiKVMs into your existing applications, and extend the capabilities of your PiKVM devices.
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.1.tar.gz
.
File metadata
- Download URL: pikvm_lib-0.1.1.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 | 9bb129aa9e650063d024b2513daee69421da623a421e537b258355d6c9a6c974 |
|
MD5 | f3a453e0f594ff9da6c5d82490d84278 |
|
BLAKE2b-256 | f7cab52e29484471d3c7d5ab7062fb4629f85003000b0b50ff9511a5932386aa |
File details
Details for the file pikvm_lib-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pikvm_lib-0.1.1-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 | 0d7fe9005e3770e25ff1bf20ca90728ad8a0822449efb6e104e5ed2883e21810 |
|
MD5 | ca96620e50b6f63c2e43e24ba7ae0309 |
|
BLAKE2b-256 | cf58b31c9b83b4de2fbb3de26040457ce917abae1029484175bcd2438b3d55f1 |