Ravenports generated: 07 Jun 2024 00:12
[ravenports.git] / bucket_42 / python-scp
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-scp
4 VERSION=                0.15.0
5 KEYWORDS=               python
6 VARIANTS=               v11 v12
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]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/79/b3/561cd6afa959e9dd522af12acc4f803e8bab1bd0e383bffc5211721c5fcb
14 DISTFILE[1]=            scp-0.15.0-py2.py3-none-any.whl:main
15 DF_INDEX=               1
16 SPKGS[v11]=             single
17 SPKGS[v12]=             single
18
19 OPTIONS_AVAILABLE=      PY311 PY312
20 OPTIONS_STANDARD=       none
21 VOPTS[v11]=             PY311=ON PY312=OFF
22 VOPTS[v12]=             PY311=OFF PY312=ON
23
24 DISTNAME=               scp-0.15.0.dist-info
25
26 GENERATED=              yes
27
28 [PY311].RUN_DEPENDS_ON=                 python-paramiko:single:v11
29 [PY311].USES_ON=                        python:v11,wheel
30
31 [PY312].RUN_DEPENDS_ON=                 python-paramiko:single:v12
32 [PY312].USES_ON=                        python:v12,wheel
33
34 [FILE:2494:descriptions/desc.single]
35 Pure python scp module
36 ======================
37
38 The scp.py module uses a paramiko transport to send and receive files via
39 the
40 scp1 protocol. This is the protocol as referenced from the openssh scp
41 program,
42 and has only been tested with this implementation.
43
44 Example
45 -------
46
47 ..  code-block:: python
48
49     from paramiko import SSHClient
50     from scp import SCPClient
51
52     ssh = SSHClient()
53     ssh.load_system_host_keys()
54     ssh.connect('example.com')
55
56     # SCPCLient takes a paramiko transport as an argument
57     scp = SCPClient(ssh.get_transport())
58
59     scp.put('test.txt', 'test2.txt')
60     scp.get('test2.txt')
61
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')
65
66     scp.close()
67
68 ..  code-block::
69
70     $ md5sum test.txt test2.txt
71     fc264c65fb17b7db5237cf7ce1780769 test.txt
72     fc264c65fb17b7db5237cf7ce1780769 test2.txt
73
74 Using 'with' keyword
75 --------------------
76
77 ..  code-block:: python
78
79     from paramiko import SSHClient
80     from scp import SCPClient
81
82     with SSHClient() as ssh:
83         ssh.load_system_host_keys()
84         ssh.connect('example.com')
85
86         with SCPClient(ssh.get_transport()) as scp:
87             scp.put('test.txt', 'test2.txt')
88             scp.get('test2.txt')
89
90 ..  code-block::
91
92     $ md5sum test.txt test2.txt
93     fc264c65fb17b7db5237cf7ce1780769 test.txt
94     fc264c65fb17b7db5237cf7ce1780769 test2.txt
95
96 Uploading file-like objects
97 ---------------------------
98
99 The putfo method can be used to upload file-like objects:
100
101 ..  code-block:: python
102
103     import io
104     from paramiko import SSHClient
105     from scp import SCPClient
106
107     ssh = SSHClient()
108     ssh.load_system_host_keys()
109     ssh.connect('example.com')
110
111     # SCPCLient takes a paramiko transport as an argument
112     scp = SCPClient(ssh.get_transport())
113
114     # generate in-memory file-like object
115     fl = io.BytesIO()
116     fl.write(b'test')
117     fl.seek(0)
118     # upload it directly from memory
119     scp.putfo(fl, '/tmp/test.txt')
120     # close connection
121     scp.close()
122     # close file handler
123     fl.close()
124
125 Tracking progress of your file uploads/downloads
126 ------------------------------------------------
127
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.
131
132 ..  code-block:: python
133
134     from paramiko import SSHClient
135
136
137 [FILE:110:distinfo]
138 9e7f721e5ac563c33eb0831d0f949c6342f1c28c3bdc3b02f39d77b5ea20df7e         8753 scp-0.15.0-py2.py3-none-any.whl
139