bluechi


Namebluechi JSON
Version 0.8.0 PyPI version JSON
download
home_pagehttps://github.com/eclipse-bluechi/bluechi/
SummaryPython bindings for BlueChi's D-Bus API
upload_time2024-04-29 11:43:07
maintainerNone
docs_urlNone
authorBlueChi developers
requires_python>=3.9
licenseLGPL-2.1-or-later
keywords bluechi python d-bus systemd
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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 description
- `ext`: custom written code to simplify common tasks

## Installation

Using `pip3`:

```sh
# 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:

```python
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:

```python
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)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eclipse-bluechi/bluechi/",
    "name": "bluechi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "bluechi, python, D-Bus, systemd",
    "author": "BlueChi developers",
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# BlueChi Python bindings\n\nThe BlueChi Python bindings provides a Python module to interact with the D-Bus API of BlueChi. It consists of the\nfollowing subpackages:\n\n- `api`: auto-generated code based the BlueChi D-BUS API description\n- `ext`: custom written code to simplify common tasks\n\n## Installation\n\nUsing `pip3`:\n\n```sh\n# from PyPi\npip3 install bluechi\n# or from cloned git repo\npip3 install --force dist/bluechi-<version>-py3-none-any.whl\n```\n\n## Examples\n\nListing all connected nodes and their current state:\n\n```python\nfrom bluechi.api import Controller\n\nfor node in Controller().list_nodes():\n    # node[name, obj_path, status]\n    print(f\"Node: {node[0]}, State: {node[3]}\")\n```\n\nStarting and stopping of a systemd unit on a specific node using the `Unit` class from the `ext` subpackage to\nimplicitly wait for the job to finish:\n\n```python\nfrom bluechi.ext import Unit\n\nhu = Unit(\"my-node-name\")\n\nresult = hu.start_unit(\"chronyd.service\")\nprint(result)\n\nresult = hu.stop_unit(\"chronyd.service\")\nprint(result)\n```\n",
    "bugtrack_url": null,
    "license": "LGPL-2.1-or-later",
    "summary": "Python bindings for BlueChi's D-Bus API",
    "version": "0.8.0",
    "project_urls": {
        "Homepage": "https://github.com/eclipse-bluechi/bluechi/"
    },
    "split_keywords": [
        "bluechi",
        " python",
        " d-bus",
        " systemd"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8641e1a47335e2ea2de98b5dc9f8582f95ed5d5959709791a3cb5a055da2444",
                "md5": "0b5544698d2167dc477f0a4df3cc46a1",
                "sha256": "e2e41d149c4400bbc2b3bc55b2b11081d0905712db101a71309f6c4687f85534"
            },
            "downloads": -1,
            "filename": "bluechi-0.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0b5544698d2167dc477f0a4df3cc46a1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 19440,
            "upload_time": "2024-04-29T11:43:07",
            "upload_time_iso_8601": "2024-04-29T11:43:07.497847Z",
            "url": "https://files.pythonhosted.org/packages/b8/64/1e1a47335e2ea2de98b5dc9f8582f95ed5d5959709791a3cb5a055da2444/bluechi-0.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-29 11:43:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eclipse-bluechi",
    "github_project": "bluechi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "bluechi"
}
        
Elapsed time: 0.27163s