Skip to main content

qaviton ssh

Project description

Qaviton SSH

logo
version license open issues downloads code size

making ssh super easy

Installation

pip install --upgrade qaviton_ssh

Requirements

  • Python 3.6+

Features

  • simple ssh send-recieve api ✓
  • async requests ✗ (coming soon)
  • multi-session workflow ✗ (coming soon)

Usage

creating an ssh client

from qaviton_ssh import SSH
# hostname is a reachable address for the machine
# username is the allowed user to have ssh access
# private_key is the file path or string of the private key
client = SSH(hostname='x.x.x.x', username='username', private_key='pkey.pem')

response = client.send('echo "hello world"')
print(response.data, response.error)  # server will respond with b'hello world', b''

create a python script on the server

cd = 'cd myproject'
file = 'script.py'
response = client.send_many([cd, f'touch {file}', f'echo "print(\"script success\")" > {file}'])
assert not response.error

execute the script

response = client.send_many([cd, f'python {file}'])
assert not response.error
print(response.data)  # server will respond with b'script success'

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

Built Distribution

qaviton_ssh-2019.10.18.22.29.29.465016-py2.py3-none-any.whl (8.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file qaviton_ssh-2019.10.18.22.29.29.465016.tar.gz.

File metadata

  • Download URL: qaviton_ssh-2019.10.18.22.29.29.465016.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7

File hashes

Hashes for qaviton_ssh-2019.10.18.22.29.29.465016.tar.gz
Algorithm Hash digest
SHA256 02e7eb529265596056443302f460b5883d508534ee9e09068e979db8492fe114
MD5 ef1b719ffcfe35d4c7ee69b7df589b42
BLAKE2b-256 ba88a6050b351403b80a249878d345db51fc25aa174a1ffec599fb239bcb7193

See more details on using hashes here.

File details

Details for the file qaviton_ssh-2019.10.18.22.29.29.465016-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for qaviton_ssh-2019.10.18.22.29.29.465016-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 426282e9ad4d73e24c8f8605ec0d4add08809f4288ff3848f55b45a6bdc00b20
MD5 9049ef8f1898d99d696a37fcc62dfc24
BLAKE2b-256 444a06d4d40888f7563a6f5dcc0bb25f176054003b9d453647eb5f72cb501d7a

See more details on using hashes here.

Supported by

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