scp module for paramiko
Project description
Pure python scp module
======================
The scp.py module uses a paramiko transport to send and recieve files via the
scp1 protocol. This is the protocol as referenced from the openssh scp program,
and has only been tested with this implementation.
Example
-------
.. code-block:: python
from paramiko import SSHClient
from scp import SCPClient
ssh = SSHClient()
ssh.load_system_host_keys()
ssh.connect('example.com')
# SCPCLient takes a paramiko transport as its only argument
scp = SCPClient(ssh.get_transport())
scp.put('test.txt', 'test2.txt')
scp.get('test2.txt')
scp.close()
.. code-block::
$ md5sum test.txt test2.txt
fc264c65fb17b7db5237cf7ce1780769 test.txt
fc264c65fb17b7db5237cf7ce1780769 test2.txt
Using 'with' keyword
------------------
.. code-block:: python
from paramiko import SSHClient
from scp import SCPClient
ssh = SSHClient()
ssh.load_system_host_keys()
ssh.connect('example.com')
with SCPClient(ssh.get_transport()) as scp:
scp.put('test.txt', 'test2.txt')
scp.get('test2.txt')
.. code-block::
$ md5sum test.txt test2.txt
fc264c65fb17b7db5237cf7ce1780769 test.txt
fc264c65fb17b7db5237cf7ce1780769 test2.txt
======================
The scp.py module uses a paramiko transport to send and recieve files via the
scp1 protocol. This is the protocol as referenced from the openssh scp program,
and has only been tested with this implementation.
Example
-------
.. code-block:: python
from paramiko import SSHClient
from scp import SCPClient
ssh = SSHClient()
ssh.load_system_host_keys()
ssh.connect('example.com')
# SCPCLient takes a paramiko transport as its only argument
scp = SCPClient(ssh.get_transport())
scp.put('test.txt', 'test2.txt')
scp.get('test2.txt')
scp.close()
.. code-block::
$ md5sum test.txt test2.txt
fc264c65fb17b7db5237cf7ce1780769 test.txt
fc264c65fb17b7db5237cf7ce1780769 test2.txt
Using 'with' keyword
------------------
.. code-block:: python
from paramiko import SSHClient
from scp import SCPClient
ssh = SSHClient()
ssh.load_system_host_keys()
ssh.connect('example.com')
with SCPClient(ssh.get_transport()) as scp:
scp.put('test.txt', 'test2.txt')
scp.get('test2.txt')
.. code-block::
$ md5sum test.txt test2.txt
fc264c65fb17b7db5237cf7ce1780769 test.txt
fc264c65fb17b7db5237cf7ce1780769 test2.txt
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
scp-0.10.2.tar.gz
(6.2 kB
view details)
Built Distribution
File details
Details for the file scp-0.10.2.tar.gz
.
File metadata
- Download URL: scp-0.10.2.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18f59e48df67fac0b069591609a0f4d50d781a101ddb8ec705f0c2e3501a8386 |
|
MD5 | 4c581a7fc08b3597b542aab22c36dba3 |
|
BLAKE2b-256 | 1da9618f1e40e30c69ffab668493953e74e6c266f383af6e34e1b8f089e41139 |
File details
Details for the file scp-0.10.2-py2.py3-none-any.whl
.
File metadata
- Download URL: scp-0.10.2-py2.py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9545014f4078f33bcef9cf1d93f7de6b3acc271552aeb2c20a1ca12f9d5abdec |
|
MD5 | 9dad181f340cabb0a29e336d3c974f2c |
|
BLAKE2b-256 | f0a3bbb4a86cca67fd9db8527caae4221dc14e1900f81cc9caff1ac4724ea838 |