1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
6 VARIANTS= py27 py38 py37
7 SDESC[py37]= Scp module for paramiko (PY 37)
8 SDESC[py38]= Scp module for paramiko (PY 38)
9 SDESC[py27]= Scp module for paramiko (PY 27)
10 HOMEPAGE= https://github.com/jbardin/scp.py
11 CONTACT= Python_Automaton[python@ironwolf.systems]
14 SITES[main]= PYPI/s/scp
15 DISTFILE[1]= scp-0.13.2.tar.gz:main
21 OPTIONS_AVAILABLE= PY27 PY38 PY37
22 OPTIONS_STANDARD= none
23 VOPTS[py37]= PY27=OFF PY38=OFF PY37=ON
24 VOPTS[py38]= PY27=OFF PY38=ON PY37=OFF
25 VOPTS[py27]= PY27=ON PY38=OFF PY37=OFF
31 [PY37].BUILDRUN_DEPENDS_ON= python-paramiko:single:py37
32 [PY37].USES_ON= python:py37
34 [PY38].BUILDRUN_DEPENDS_ON= python-paramiko:single:py38
35 [PY38].USES_ON= python:py38
37 [PY27].BUILDRUN_DEPENDS_ON= python-paramiko:single:py27
38 [PY27].USES_ON= python:py27
40 [FILE:2420:descriptions/desc.single]
41 Pure python scp module
42 ======================
44 The scp.py module uses a paramiko transport to send and recieve files via
46 scp1 protocol. This is the protocol as referenced from the openssh scp
48 and has only been tested with this implementation.
54 .. code-block:: python
56 from paramiko import SSHClient
57 from scp import SCPClient
60 ssh.load_system_host_keys()
61 ssh.connect('example.com')
63 # SCPCLient takes a paramiko transport as an argument
64 scp = SCPClient(ssh.get_transport())
66 scp.put('test.txt', 'test2.txt')
69 # Uploading the 'test' directory with its content in the
70 # '/home/user/dump' remote directory
71 scp.put('test', recursive=True, remote_path='/home/user/dump')
78 $ md5sum test.txt test2.txt
79 fc264c65fb17b7db5237cf7ce1780769 test.txt
80 fc264c65fb17b7db5237cf7ce1780769 test2.txt
85 .. code-block:: python
87 from paramiko import SSHClient
88 from scp import SCPClient
91 ssh.load_system_host_keys()
92 ssh.connect('example.com')
94 with SCPClient(ssh.get_transport()) as scp:
95 scp.put('test.txt', 'test2.txt')
101 $ md5sum test.txt test2.txt
102 fc264c65fb17b7db5237cf7ce1780769 test.txt
103 fc264c65fb17b7db5237cf7ce1780769 test2.txt
106 Uploading file-like objects
107 ---------------------------
109 The ``putfo`` method can be used to upload file-like objects:
111 .. code-block:: python
114 from paramiko import SSHClient
115 from scp import SCPClient
118 ssh.load_system_host_keys()
119 ssh.connect('example.com')
121 # SCPCLient takes a paramiko transport as an argument
122 scp = SCPClient(ssh.get_transport())
124 # generate in-memory file-like object
128 # upload it directly from memory
129 scp.putfo(fl, '/tmp/test.txt')
136 Tracking progress of your file uploads/downloads
137 ------------------------------------------------
139 A ``progress`` function can be given as a callback to the SCPClient to
141 how the current SCP operation handles the progress of the transfers. In the
142 example below we print the percentage complete of the file transfer.
147 ef9d6e67c0331485d3db146bf9ee9baff8a48f3eb0e6c08276a8584b13bf34b3 11517 scp-0.13.2.tar.gz