1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[v11]= Scp module for paramiko (3.11)
8 SDESC[v12]= Scp module for paramiko (3.12)
9 HOMEPAGE= https://github.com/jbardin/scp.py
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/79/b3/561cd6afa959e9dd522af12acc4f803e8bab1bd0e383bffc5211721c5fcb
14 DISTFILE[1]= scp-0.15.0-py2.py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY311 PY312
20 OPTIONS_STANDARD= none
21 VOPTS[v11]= PY311=ON PY312=OFF
22 VOPTS[v12]= PY311=OFF PY312=ON
24 DISTNAME= scp-0.15.0.dist-info
28 [PY311].RUN_DEPENDS_ON= python-paramiko:single:v11
29 [PY311].USES_ON= python:v11,wheel
31 [PY312].RUN_DEPENDS_ON= python-paramiko:single:v12
32 [PY312].USES_ON= python:v12,wheel
34 [FILE:2494:descriptions/desc.single]
35 Pure python scp module
36 ======================
38 The scp.py module uses a paramiko transport to send and receive files via
40 scp1 protocol. This is the protocol as referenced from the openssh scp
42 and has only been tested with this implementation.
47 .. code-block:: python
49 from paramiko import SSHClient
50 from scp import SCPClient
53 ssh.load_system_host_keys()
54 ssh.connect('example.com')
56 # SCPCLient takes a paramiko transport as an argument
57 scp = SCPClient(ssh.get_transport())
59 scp.put('test.txt', 'test2.txt')
62 # Uploading the 'test' directory with its content in the
63 # '/home/user/dump' remote directory
64 scp.put('test', recursive=True, remote_path='/home/user/dump')
70 $ md5sum test.txt test2.txt
71 fc264c65fb17b7db5237cf7ce1780769 test.txt
72 fc264c65fb17b7db5237cf7ce1780769 test2.txt
77 .. code-block:: python
79 from paramiko import SSHClient
80 from scp import SCPClient
82 with SSHClient() as ssh:
83 ssh.load_system_host_keys()
84 ssh.connect('example.com')
86 with SCPClient(ssh.get_transport()) as scp:
87 scp.put('test.txt', 'test2.txt')
92 $ md5sum test.txt test2.txt
93 fc264c65fb17b7db5237cf7ce1780769 test.txt
94 fc264c65fb17b7db5237cf7ce1780769 test2.txt
96 Uploading file-like objects
97 ---------------------------
99 The putfo method can be used to upload file-like objects:
101 .. code-block:: python
104 from paramiko import SSHClient
105 from scp import SCPClient
108 ssh.load_system_host_keys()
109 ssh.connect('example.com')
111 # SCPCLient takes a paramiko transport as an argument
112 scp = SCPClient(ssh.get_transport())
114 # generate in-memory file-like object
118 # upload it directly from memory
119 scp.putfo(fl, '/tmp/test.txt')
125 Tracking progress of your file uploads/downloads
126 ------------------------------------------------
128 A progress function can be given as a callback to the SCPClient to handle
129 how the current SCP operation handles the progress of the transfers. In the
130 example below we print the percentage complete of the file transfer.
132 .. code-block:: python
134 from paramiko import SSHClient
138 9e7f721e5ac563c33eb0831d0f949c6342f1c28c3bdc3b02f39d77b5ea20df7e 8753 scp-0.15.0-py2.py3-none-any.whl