Skip to main content

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

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

scp-0.10.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

scp-0.10.1-py2.py3-none-any.whl (7.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file scp-0.10.1.tar.gz.

File metadata

  • Download URL: scp-0.10.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for scp-0.10.1.tar.gz
Algorithm Hash digest
SHA256 93eccf07955f891d2638683035461bb3f50780d60b48315b67a51e1c94f6bd5e
MD5 312baef67125a53e1e500c60bc7f0913
BLAKE2b-256 6db9bcd73f931b190fb72ccf9d618354cb90a825ab9ba38fddd4d9fec764ae0c

See more details on using hashes here.

File details

Details for the file scp-0.10.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for scp-0.10.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9d11c9e266fd2bf3ecab8266b85e74a471a80d0c3b833f5342eeb63c9db9326d
MD5 95e5d7454725d8d15cfca4f6d03b8383
BLAKE2b-256 e84154f77870623eb4396721e0a712f34c15e10ee878ca60cccbb1a82e3118ce

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