topssh


Nametopssh JSON
Version 2024.9.27 PyPI version JSON
download
home_pageNone
Summarya package on top of fabric to use SSH easily
upload_time2024-09-29 06:51:13
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseBSD 3-Clause License Copyright (c) 2023, Lix Xu Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords ssh fabric paramiko
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # topssh

a package on top of fabric to use ssh easily

## installation

```bash
pip install topssh
```

## usage

```python
from topssh.ssh_lite import SSH
from topssh.ssh import SSH as FullSSH

host = "127.0.0.1"
user ="username"
password = "password"

# lite ssh only captures command output
ssh = SSH(host, user, password)
ssh.add_sudo_watcher()
ssh.connect(timeout=5)

out = ssh.run("hostname")
print(out)

out = ssh.run("uname -a")
print(out)

# all outpus in ssh.echo_text
print("".join(ssh.echo_text))

# full ssh cpatures all output including command input and output
ssh = FullSSH(host, user, password)
ssh.connect(timeout=5)

# add timestamps to output and ignore color chars
# ssh.patch_output()

out = ssh.run("hostname")
print(out)

out = ssh.run("uname -a")
print(out)

# all outpus in ssh.echo_text
print("".join(ssh.echo_text))

```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "topssh",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "ssh, fabric, paramiko",
    "author": null,
    "author_email": "Lix Xu <xuzenglin@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/83/48/089604ac7dd31397c065fa98a4d1c81d2b8bf44e477e92b6c2415289ac1b/topssh-2024.9.27.tar.gz",
    "platform": null,
    "description": "# topssh\r\n\r\na package on top of fabric to use ssh easily\r\n\r\n## installation\r\n\r\n```bash\r\npip install topssh\r\n```\r\n\r\n## usage\r\n\r\n```python\r\nfrom topssh.ssh_lite import SSH\r\nfrom topssh.ssh import SSH as FullSSH\r\n\r\nhost = \"127.0.0.1\"\r\nuser =\"username\"\r\npassword = \"password\"\r\n\r\n# lite ssh only captures command output\r\nssh = SSH(host, user, password)\r\nssh.add_sudo_watcher()\r\nssh.connect(timeout=5)\r\n\r\nout = ssh.run(\"hostname\")\r\nprint(out)\r\n\r\nout = ssh.run(\"uname -a\")\r\nprint(out)\r\n\r\n# all outpus in ssh.echo_text\r\nprint(\"\".join(ssh.echo_text))\r\n\r\n# full ssh cpatures all output including command input and output\r\nssh = FullSSH(host, user, password)\r\nssh.connect(timeout=5)\r\n\r\n# add timestamps to output and ignore color chars\r\n# ssh.patch_output()\r\n\r\nout = ssh.run(\"hostname\")\r\nprint(out)\r\n\r\nout = ssh.run(\"uname -a\")\r\nprint(out)\r\n\r\n# all outpus in ssh.echo_text\r\nprint(\"\".join(ssh.echo_text))\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2023, Lix Xu  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "a package on top of fabric to use SSH easily",
    "version": "2024.9.27",
    "project_urls": {
        "Bug Tracker": "https://github.com/lixxu/topssh/issues",
        "Homepage": "https://github.com/lixxu/topssh"
    },
    "split_keywords": [
        "ssh",
        " fabric",
        " paramiko"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "87bfacd80118b4f0db2ae2b44aa2e66b3e0c4d9b58078e0fc5087881f03cc6af",
                "md5": "01a1d8fc52d6e76992754043602b7fde",
                "sha256": "66c74235e35a62b055678a759d3ecefe09ef3463d1ca6fdf0d07d3a265e0456b"
            },
            "downloads": -1,
            "filename": "topssh-2024.9.27-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "01a1d8fc52d6e76992754043602b7fde",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7052,
            "upload_time": "2024-09-29T06:51:12",
            "upload_time_iso_8601": "2024-09-29T06:51:12.258087Z",
            "url": "https://files.pythonhosted.org/packages/87/bf/acd80118b4f0db2ae2b44aa2e66b3e0c4d9b58078e0fc5087881f03cc6af/topssh-2024.9.27-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8348089604ac7dd31397c065fa98a4d1c81d2b8bf44e477e92b6c2415289ac1b",
                "md5": "5a61f1a6cacaea37f8a3ff6c23452511",
                "sha256": "708c6b28c633a999de8b8093a1adbda015473c7fe012075f85932abbc7d2fd87"
            },
            "downloads": -1,
            "filename": "topssh-2024.9.27.tar.gz",
            "has_sig": false,
            "md5_digest": "5a61f1a6cacaea37f8a3ff6c23452511",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5330,
            "upload_time": "2024-09-29T06:51:13",
            "upload_time_iso_8601": "2024-09-29T06:51:13.864204Z",
            "url": "https://files.pythonhosted.org/packages/83/48/089604ac7dd31397c065fa98a4d1c81d2b8bf44e477e92b6c2415289ac1b/topssh-2024.9.27.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-29 06:51:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lixxu",
    "github_project": "topssh",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "topssh"
}
        
Elapsed time: 0.34720s