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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
bluechi-0.9.0-py3-none-any.whl
(20.0 kB
view details)
File details
Details for the file bluechi-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: bluechi-0.9.0-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3030cf9ea05ea894e7c489afda958055e4b4ab1536e9d0c6c1f922a49047bed |
|
MD5 | 8b1602e7004c151d7433fae71439c1e7 |
|
BLAKE2b-256 | e7c498bf062f6cace99a116fe0a30fba9ee1d66fdb3b351d657eae70029b3228 |