topssh


Nametopssh JSON
Version 2024.1.31 PyPI version JSON
download
home_page
Summarya package on top of fabric to use SSH easily
upload_time2024-01-31 09:28:15
maintainer
docs_urlNone
author
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": "",
    "name": "topssh",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "ssh,fabric,paramiko",
    "author": "",
    "author_email": "Lix Xu <xuzenglin@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/8c/66/11a3836667bc02f6a9eeb54671b5cc996a200e1c6470268bb93a06c90607/topssh-2024.1.31.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.1.31",
    "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": "a6d4f520c2b9b6879da1fa0ee706c37363b8a10b2264e4869289c4d0b323d4a1",
                "md5": "4e8b31ad59d41c03878197ae5ddc7388",
                "sha256": "5e2a50b3cc23c7abcab13027ec516d56f1a8a6eff5c19cb4c700021359ab4f94"
            },
            "downloads": -1,
            "filename": "topssh-2024.1.31-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4e8b31ad59d41c03878197ae5ddc7388",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6889,
            "upload_time": "2024-01-31T09:28:12",
            "upload_time_iso_8601": "2024-01-31T09:28:12.438951Z",
            "url": "https://files.pythonhosted.org/packages/a6/d4/f520c2b9b6879da1fa0ee706c37363b8a10b2264e4869289c4d0b323d4a1/topssh-2024.1.31-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c6611a3836667bc02f6a9eeb54671b5cc996a200e1c6470268bb93a06c90607",
                "md5": "f1021ef9825dc4cae235299bb56427d2",
                "sha256": "0f5d2689244b5da6251db37566eba90e57d5ecc83b3d76f314d1f91334421361"
            },
            "downloads": -1,
            "filename": "topssh-2024.1.31.tar.gz",
            "has_sig": false,
            "md5_digest": "f1021ef9825dc4cae235299bb56427d2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5176,
            "upload_time": "2024-01-31T09:28:15",
            "upload_time_iso_8601": "2024-01-31T09:28:15.219559Z",
            "url": "https://files.pythonhosted.org/packages/8c/66/11a3836667bc02f6a9eeb54671b5cc996a200e1c6470268bb93a06c90607/topssh-2024.1.31.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-31 09:28:15",
    "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.17895s