ssh-remote-control


Namessh-remote-control JSON
Version 0.2.1 PyPI version JSON
download
home_page
SummaryControl and monitor remote devices through SSH
upload_time2023-06-30 11:26:56
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords ssh command line remote control
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SSH Remote Control

## Initialize

```python
from ssh_remote_control import Remote

remote = Remote("192.168.0.123", ssh_user="user", ssh_password="1234")

# Will raise an error if the host is not online or the SSH connection fails
await remote.async_update_state(validate=True)

# Check the remote state
remote.state.is_online
remote.state.is_connected
```

## Initialize with a command set

```python
from ssh_remote_control.default_command_sets import linux, ServiceKey, SensorKey

remote = Remote("192.168.0.123", ssh_user="user", ssh_password="1234", command_set=linux)

await remote.async_update_state(validate=True)

# Get the value of a sensor
remote.get_sensor(SensorKey.CPU_LOAD).value

# Call a service
await remote.async_call_service(ServiceKey.RESTART)
```

## Execute a command

```python
from ssh_remote_control import Command

output = await remote.async_execute(Command("echo Hello from host"))
output.stdout
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ssh-remote-control",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "ssh,command line,remote control",
    "author": "",
    "author_email": "zhbjsh <zhbjsh@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/0b/35/7a0df3da24960f6a2d77e0c34cdc54f03c71e4db52e5d88a591a9068ea7b/ssh_remote_control-0.2.1.tar.gz",
    "platform": null,
    "description": "# SSH Remote Control\r\n\r\n## Initialize\r\n\r\n```python\r\nfrom ssh_remote_control import Remote\r\n\r\nremote = Remote(\"192.168.0.123\", ssh_user=\"user\", ssh_password=\"1234\")\r\n\r\n# Will raise an error if the host is not online or the SSH connection fails\r\nawait remote.async_update_state(validate=True)\r\n\r\n# Check the remote state\r\nremote.state.is_online\r\nremote.state.is_connected\r\n```\r\n\r\n## Initialize with a command set\r\n\r\n```python\r\nfrom ssh_remote_control.default_command_sets import linux, ServiceKey, SensorKey\r\n\r\nremote = Remote(\"192.168.0.123\", ssh_user=\"user\", ssh_password=\"1234\", command_set=linux)\r\n\r\nawait remote.async_update_state(validate=True)\r\n\r\n# Get the value of a sensor\r\nremote.get_sensor(SensorKey.CPU_LOAD).value\r\n\r\n# Call a service\r\nawait remote.async_call_service(ServiceKey.RESTART)\r\n```\r\n\r\n## Execute a command\r\n\r\n```python\r\nfrom ssh_remote_control import Command\r\n\r\noutput = await remote.async_execute(Command(\"echo Hello from host\"))\r\noutput.stdout\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Control and monitor remote devices through SSH",
    "version": "0.2.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/zhbjsh/ssh-remote-control/issues",
        "Homepage": "https://github.com/zhbjsh/ssh-remote-control"
    },
    "split_keywords": [
        "ssh",
        "command line",
        "remote control"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c20be1775a7dfeee96248a3f5e8c7e9ac06ada3fca96d22c89b7956c7c320761",
                "md5": "a2050eebd0b29e67f7265ffaf6d37a4d",
                "sha256": "6d16ec974f4dfb985b838a18d01fdd719e233611e32bf7abeeeefd4bdf04d3c9"
            },
            "downloads": -1,
            "filename": "ssh_remote_control-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a2050eebd0b29e67f7265ffaf6d37a4d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 17136,
            "upload_time": "2023-06-30T11:26:50",
            "upload_time_iso_8601": "2023-06-30T11:26:50.885696Z",
            "url": "https://files.pythonhosted.org/packages/c2/0b/e1775a7dfeee96248a3f5e8c7e9ac06ada3fca96d22c89b7956c7c320761/ssh_remote_control-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0b357a0df3da24960f6a2d77e0c34cdc54f03c71e4db52e5d88a591a9068ea7b",
                "md5": "33ca00f5dcf94132d6f786630b75a708",
                "sha256": "5fda27db357886a8ffe986008bf1eeb88910c0664462c8943313016da7e52d1d"
            },
            "downloads": -1,
            "filename": "ssh_remote_control-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "33ca00f5dcf94132d6f786630b75a708",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 13303,
            "upload_time": "2023-06-30T11:26:56",
            "upload_time_iso_8601": "2023-06-30T11:26:56.534933Z",
            "url": "https://files.pythonhosted.org/packages/0b/35/7a0df3da24960f6a2d77e0c34cdc54f03c71e4db52e5d88a591a9068ea7b/ssh_remote_control-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-30 11:26:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "zhbjsh",
    "github_project": "ssh-remote-control",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ssh-remote-control"
}
        
Elapsed time: 0.48271s