Skip to main content

pexpect for asyncssh and paramiko

Project description

sshexpect

Overview

This library adapts pexpect to work with asyncssh and paramiko

See wiki for more information.

asyncssh example

import asyncssh
import sshexpect

connection = await asyncssh.connect(...)

child = await sshexpect.spawn(connection, "bash")

await child.expect(...)
print(child.before)
child.sendline(...)

child.terminate()

paramiko example

import paramiko
import sshexpect

connection = paramiko.SSHClient()
connection.connect(...)

child = sshexpect.spawn(connection, "bash")

child.expect(...)
print(child.before)
child.sendline(...)

child.terminate()

Installation

pip install sshexpect

License

The MIT License (MIT)

Copyright (c) 2022 Dmytro Pavliuk

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sshexpect-1.0.6.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

sshexpect-1.0.6-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file sshexpect-1.0.6.tar.gz.

File metadata

  • Download URL: sshexpect-1.0.6.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for sshexpect-1.0.6.tar.gz
Algorithm Hash digest
SHA256 7db91dfbff1502b06159c8e9d66e91b067e6eb8c0f18ba3e4757f15418a340bd
MD5 432e1cf10aca3d975482bfb3cda5239a
BLAKE2b-256 7059620e0e07490a4605411d6d81e505d195ca57b3a364900d565d0f38e0cb05

See more details on using hashes here.

File details

Details for the file sshexpect-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: sshexpect-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for sshexpect-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d12aaafb673f945175c6ee8e9965b63415637662ec530ea0527ac0d508b5cc7b
MD5 eab09a3ddf4b3859a43d9803aa8b445b
BLAKE2b-256 24b4316968682f8f94d6af58371012333e954d6743716bfe8aa28d4e0b55cf4b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page