qaviton ssh
Project description
Qaviton SSH
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
Release history Release notifications | RSS feed
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
Close
Hashes for qaviton_ssh-2019.9.28.8.34.55.899054.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32f0f7d3ded41be329bf8d1e6607faebbfca932ddb52a116130e7478e0b8e848 |
|
MD5 | 1e0d408fa7dbec9dcf9136675a5e2c6c |
|
BLAKE2b-256 | 15e19663d21ce5769eb4c1fd7ce0193dd98ce9fb70e478b76d8d596b2d8d25f9 |
Close
Hashes for qaviton_ssh-2019.9.28.8.34.55.899054-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fbbff7df6cbbb07a75cf1dbf3ef941515c92c188937f97e801a4851f70ff0c6 |
|
MD5 | ba26238e0f8d22b1ebd5bad731c841e3 |
|
BLAKE2b-256 | 61cbeeff0a37fa92897343e8edc9b02dd2209c388b129ef99d13785541c2b2cd |