Python bindings for BlueChi's D-Bus API
Project description
BlueChi Python bindings
The BlueChi Python bindings provides a Python module to interact with the D-Bus API of BlueChi. It consists of the following subpackages:
api: auto-generated code based the BlueChi D-BUS API descriptionext: custom written code to simplify common tasks
Installation
Using pip3:
# from PyPi
pip3 install bluechi
# or from cloned git repo
pip3 install --force dist/bluechi-<version>-py3-none-any.whl
Examples
Listing all connected nodes and their current state:
from bluechi.api import Controller
for node in Controller().list_nodes():
# node[name, obj_path, status]
print(f"Node: {node[0]}, State: {node[3]}")
Starting and stopping of a systemd unit on a specific node using the Unit class from the ext subpackage to
implicitly wait for the job to finish:
from bluechi.ext import Unit
hu = Unit("my-node-name")
result = hu.start_unit("chronyd.service")
print(result)
result = hu.stop_unit("chronyd.service")
print(result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bluechi-1.2.1-py3-none-any.whl.
File metadata
- Download URL: bluechi-1.2.1-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
746d606b54790ed0a9d3bf07bb00bf8795bbcb75818e3dd06c94232583bd4b39
|
|
| MD5 |
553a236fe3ebed3d505386494d6cf2c5
|
|
| BLAKE2b-256 |
9eb3c5d3fd67bdacb2ab52eb9e32db6d2fbd62b1f4afcca7f51e35b68fe6e613
|