sshline 0.1.0__cp310-abi3-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
sshline/__init__.py ADDED
@@ -0,0 +1,27 @@
1
+ from sshline._sshline import (
2
+ AsyncClient,
3
+ AsyncSftpClient,
4
+ AuthError,
5
+ Client,
6
+ ExecResult,
7
+ HostKeyError,
8
+ SftpClient,
9
+ SFTPError,
10
+ SftpStat,
11
+ SSHError,
12
+ TimeoutError,
13
+ )
14
+
15
+ __all__ = [
16
+ "AsyncClient",
17
+ "AsyncSftpClient",
18
+ "AuthError",
19
+ "Client",
20
+ "ExecResult",
21
+ "HostKeyError",
22
+ "SFTPError",
23
+ "SSHError",
24
+ "SftpClient",
25
+ "SftpStat",
26
+ "TimeoutError",
27
+ ]
sshline/__init__.pyi ADDED
@@ -0,0 +1,127 @@
1
+ import os
2
+ from types import TracebackType
3
+
4
+ class SSHError(Exception): ...
5
+ class AuthError(SSHError): ...
6
+ class HostKeyError(SSHError): ...
7
+ class SFTPError(SSHError): ...
8
+ class TimeoutError(SSHError): ...
9
+
10
+ class ExecResult:
11
+ @property
12
+ def stdout(self) -> bytes: ...
13
+ @property
14
+ def stderr(self) -> bytes: ...
15
+ @property
16
+ def exit_code(self) -> int: ...
17
+ def text(self, encoding: str = "utf-8", errors: str = "replace") -> str: ...
18
+
19
+ class SftpStat:
20
+ @property
21
+ def size(self) -> int | None: ...
22
+ @property
23
+ def permissions(self) -> int | None: ...
24
+ @property
25
+ def uid(self) -> int | None: ...
26
+ @property
27
+ def gid(self) -> int | None: ...
28
+ @property
29
+ def atime(self) -> int | None: ...
30
+ @property
31
+ def mtime(self) -> int | None: ...
32
+ @property
33
+ def is_dir(self) -> bool: ...
34
+ @property
35
+ def is_file(self) -> bool: ...
36
+ @property
37
+ def is_symlink(self) -> bool: ...
38
+
39
+ class SftpClient:
40
+ def put(self, local_path: str | os.PathLike[str], remote_path: str) -> None: ...
41
+ def get(self, remote_path: str, local_path: str | os.PathLike[str]) -> None: ...
42
+ def listdir(self, path: str) -> list[str]: ...
43
+ def stat(self, path: str) -> SftpStat: ...
44
+ def remove(self, path: str) -> None: ...
45
+
46
+ class AsyncSftpClient:
47
+ async def put(self, local_path: str | os.PathLike[str], remote_path: str) -> None: ...
48
+ async def get(self, remote_path: str, local_path: str | os.PathLike[str]) -> None: ...
49
+ async def listdir(self, path: str) -> list[str]: ...
50
+ async def stat(self, path: str) -> SftpStat: ...
51
+ async def remove(self, path: str) -> None: ...
52
+
53
+ class Client:
54
+ def __init__(
55
+ self,
56
+ host: str | None = None,
57
+ port: int = 22,
58
+ username: str | None = None,
59
+ password: str | None = None,
60
+ key_path: str | os.PathLike[str] | None = None,
61
+ passphrase: str | None = None,
62
+ known_hosts_path: str | os.PathLike[str] | None = None,
63
+ known_host_key: str | None = None,
64
+ verify_host_key: bool = True,
65
+ timeout: float | None = None,
66
+ ) -> None: ...
67
+ def connect(
68
+ self,
69
+ host: str | None = None,
70
+ port: int | None = None,
71
+ username: str | None = None,
72
+ password: str | None = None,
73
+ key_path: str | os.PathLike[str] | None = None,
74
+ passphrase: str | None = None,
75
+ known_hosts_path: str | os.PathLike[str] | None = None,
76
+ known_host_key: str | None = None,
77
+ verify_host_key: bool | None = None,
78
+ timeout: float | None = None,
79
+ ) -> None: ...
80
+ def close(self) -> None: ...
81
+ def exec(self, command: str, timeout: float | None = None) -> ExecResult: ...
82
+ def sftp(self) -> SftpClient: ...
83
+ def __enter__(self) -> Client: ...
84
+ def __exit__(
85
+ self,
86
+ exc_type: type[BaseException] | None,
87
+ exc_val: BaseException | None,
88
+ exc_tb: TracebackType | None,
89
+ ) -> bool: ...
90
+
91
+ class AsyncClient:
92
+ def __init__(
93
+ self,
94
+ host: str | None = None,
95
+ port: int = 22,
96
+ username: str | None = None,
97
+ password: str | None = None,
98
+ key_path: str | os.PathLike[str] | None = None,
99
+ passphrase: str | None = None,
100
+ known_hosts_path: str | os.PathLike[str] | None = None,
101
+ known_host_key: str | None = None,
102
+ verify_host_key: bool = True,
103
+ timeout: float | None = None,
104
+ ) -> None: ...
105
+ async def connect(
106
+ self,
107
+ host: str | None = None,
108
+ port: int | None = None,
109
+ username: str | None = None,
110
+ password: str | None = None,
111
+ key_path: str | os.PathLike[str] | None = None,
112
+ passphrase: str | None = None,
113
+ known_hosts_path: str | os.PathLike[str] | None = None,
114
+ known_host_key: str | None = None,
115
+ verify_host_key: bool | None = None,
116
+ timeout: float | None = None,
117
+ ) -> None: ...
118
+ async def close(self) -> None: ...
119
+ async def exec(self, command: str, timeout: float | None = None) -> ExecResult: ...
120
+ async def sftp(self) -> AsyncSftpClient: ...
121
+ async def __aenter__(self) -> AsyncClient: ...
122
+ async def __aexit__(
123
+ self,
124
+ exc_type: type[BaseException] | None,
125
+ exc_val: BaseException | None,
126
+ exc_tb: TracebackType | None,
127
+ ) -> bool: ...
sshline/_sshline.pyd ADDED
Binary file
sshline/py.typed ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,72 @@
1
+ Metadata-Version: 2.4
2
+ Name: sshline
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Programming Language :: Rust
6
+ Classifier: Programming Language :: Python :: Implementation :: CPython
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Python :: 3.14
13
+ Classifier: Topic :: System :: Networking
14
+ License-File: LICENSE-MIT
15
+ License-File: LICENSE-APACHE
16
+ Summary: SSHv2 and SFTP client for Python backed by Rust.
17
+ License-Expression: MIT OR Apache-2.0
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
20
+ Project-URL: Homepage, https://github.com/DakshBhalala/sshline
21
+ Project-URL: Issues, https://github.com/DakshBhalala/sshline/issues
22
+ Project-URL: Repository, https://github.com/DakshBhalala/sshline
23
+
24
+ # sshline
25
+
26
+ `sshline` provides synchronous (`Client`) and `asyncio` (`AsyncClient`) SSHv2 command execution and chunked SFTP file transfer for Python backed by `russh` and `tokio`. In v0.1 it does not cover interactive PTY shells, port forwarding, `ProxyJump`, or `ssh-agent` authentication.
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ pip install sshline
32
+ ```
33
+
34
+ ## Usage
35
+
36
+ ```python
37
+ from sshline import Client
38
+
39
+ with Client(host="127.0.0.1", port=22, username="deploy", key_path="~/.ssh/id_ed25519") as ssh:
40
+ result = ssh.exec("uname -a", timeout=10.0)
41
+ print(result.exit_code, result.text())
42
+
43
+ sftp = ssh.sftp()
44
+ sftp.put("build.tar.gz", "/tmp/build.tar.gz")
45
+ sftp.get("/tmp/build.tar.gz", "downloaded.tar.gz")
46
+ ```
47
+
48
+ ## v0.1 Benchmarks
49
+
50
+ Measured via `benchmarks/bench_sshline.py` on Windows 11 x86_64, CPython 3.12.13, over `127.0.0.1` against the local release `test_server` binary (64 concurrent `echo bench` calls across 5 measured rounds after 5 warmups, plus 50 MiB SFTP `put` and `get`; each library run in an isolated subprocess):
51
+
52
+ | Library | 64x exec median (s) | 50 MB put (s) | 50 MB get (s) | Peak RSS (MB) |
53
+ | --- | ---: | ---: | ---: | ---: |
54
+ | `sshline_sync` (0.1.0) | 0.0052 | 0.1938 | 0.2483 | 31.13 |
55
+ | `sshline_async` (0.1.0) | 0.0048 | 0.1690 | 0.3506 | 32.99 |
56
+ | `paramiko` (5.1.0) | 0.0550 | 0.4034 | 1.0081 | 88.99 |
57
+ | `asyncssh` (2.24.2) | 0.0167 | 0.4994 | 0.5062 | 51.01 |
58
+
59
+ `paramiko` SFTP `get` uses `max_concurrent_prefetch_requests=32` because its default unbounded `prefetch=True` stalled against `russh_sftp`.
60
+
61
+ ## v0.1 Limits
62
+
63
+ - Supports password and key-file authentication (Ed25519, RSA, ECDSA, with optional passphrase); no `ssh-agent`, hardware tokens, or GSSAPI/Kerberos.
64
+ - Supports non-interactive `exec` and SFTP (`put`, `get`, `listdir`, `stat`, `remove`) only; no PTY allocation, interactive shell channels, port forwarding, or `ProxyJump`.
65
+ - Host key verification is enabled by default using `~/.ssh/known_hosts` or `known_host_key` and raises `HostKeyError` rather than prompting interactively; set `verify_host_key=False` explicitly for ephemeral test servers.
66
+
67
+ ## Related
68
+
69
+ - [pdfline](https://github.com/DakshBhalala/pdfline) - Programmatic PDF builder backed by `parley` and `krilla`
70
+ - [figline](https://github.com/DakshBhalala/figline) - 2D scientific plotting library backed by `tiny-skia`, `parley`, and `krilla`
71
+ - [queueline](https://github.com/DakshBhalala/queueline) - Background task queue backed by `tokio`, WAL SQLite, and Redis
72
+
@@ -0,0 +1,10 @@
1
+ sshline/__init__.py,sha256=8m_qgWa1hZNdfjq_Yqq9ryOV8_cKNjAnGO9A4mvCsiI,449
2
+ sshline/__init__.pyi,sha256=rgPM-6NLrxeL5XH3qvzW6UC0GHAx-3_6ARRV5l8Njt0,4448
3
+ sshline/_sshline.pyd,sha256=vAHpf9zdOOLr2s6ic8LCiV5AcZ1JeAPdmF6z5h15AEI,5144064
4
+ sshline/py.typed,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
5
+ sshline-0.1.0.dist-info/METADATA,sha256=0--lnxGiN2x6Ow4JmGd5-2O-df92RYG9IYqjrdYPneE,3513
6
+ sshline-0.1.0.dist-info/WHEEL,sha256=TzjyIyBUptJHnlQyOymQYLWjtXe7MGI0m3QvmcG7PpI,96
7
+ sshline-0.1.0.dist-info/licenses/LICENSE-APACHE,sha256=dVOqH9drhVtBi8vuM9z6wBw0jE2j0AjVubZHGVoNO3o,11363
8
+ sshline-0.1.0.dist-info/licenses/LICENSE-MIT,sha256=tODgO_E-OJN-ZyvBti_7zHfuHnZ0c1doARGME4fGyxo,1102
9
+ sshline-0.1.0.dist-info/sboms/sshline.cyclonedx.json,sha256=EwbFUzJ8z9gNgMWoegNX_Ik_yhfMlb_g99G4awsR8n4,230313
10
+ sshline-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.16.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp310-abi3-win_amd64
@@ -0,0 +1,199 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated into the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or indirect patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a copy of that NOTICE file in a readable format within
109
+ those distribution files, contained within a NOTICE text file
110
+ distributed as part of the Derivative Works; within the Source
111
+ form or documentation, if provided along with the Derivative
112
+ Works; or, within a display generated by the Derivative Works,
113
+ if and wherever such third-party notices normally appear. The
114
+ contents of the NOTICE file are for informational purposes only
115
+ and do not modify the License. You may add Your own NOTICE
116
+ files within Derivative Works that You distribute, alongside
117
+ or as an addendum to the NOTICE text file from the Work,
118
+ provided that such additional NOTICE notices cannot be
119
+ construed as modifying the License.
120
+
121
+ You may add Your own copyright notice to Your modifications and
122
+ may provide additional or different license terms and conditions
123
+ for use, reproduction, or distribution of Your modifications, or
124
+ for any such Derivative Works as a whole, provided Your use,
125
+ reproduction, and distribution of the Work otherwise complies with
126
+ the conditions stated in this License.
127
+
128
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
129
+ any Contribution intentionally submitted for inclusion in the Work
130
+ by You to the Licensor shall be under the terms and conditions of
131
+ this License, without any additional terms or conditions.
132
+ Notwithstanding the above, nothing herein shall supersede or modify
133
+ the terms of any separate license agreement you may have executed
134
+ with Licensor.
135
+
136
+ 6. Trademarks. This License does not grant permission to use the trade
137
+ names, trademarks, service marks, or product names of the Licensor,
138
+ except as required for reasonable and customary use in describing the
139
+ origin of the Work and reproducing the content of the NOTICE file.
140
+
141
+ 7. Disclaimer of Warranty. Unless required by applicable law or
142
+ agreed to in writing, software distributed under the License is
143
+ provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
144
+ ANY KIND, either express or implied, including, without limitation,
145
+ any warranties or conditions of TITLE, NON-INFRINGEMENT,
146
+ MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
147
+ solely responsible for determining the appropriateness of using or
148
+ redistributing the Work and assume any risks associated with Your
149
+ exercise of permissions under this License.
150
+
151
+ 8. Limitation of Liability. In no event and under no legal theory,
152
+ whether in tort (including negligence), contract, or otherwise,
153
+ unless required by applicable law (such as deliberate intent) and
154
+ otherwise arising from, out of or in connection with the Work or the
155
+ use or other dealings in the Work, shall the Licensor be liable for
156
+ any damages, including any direct, indirect, special, incidental, or
157
+ consequential damages of any character arising as a result of this
158
+ License or out of the use or other dealings in the Work (including
159
+ but not limited to damages for loss of goodwill, work stoppage,
160
+ computer failure or malfunction, or any and all other commercial
161
+ damages or losses), even if such Licensor has been advised of the
162
+ possibility of such damages.
163
+
164
+ 9. Accepting Warranty or Additional Liability. While redistributing
165
+ the Work or Derivative Works thereof, You may choose to offer,
166
+ and charge a fee for, acceptance of support, warranty, indemnity,
167
+ or other liability obligations and/or rights consistent with this
168
+ License. However, in accepting such obligations, You may act only
169
+ on Your own behalf and on Your sole responsibility, not on behalf
170
+ of any other Contributor, and only if You agree to indemnify,
171
+ defend, and hold each Contributor harmless for any liability
172
+ incurred by, or claims asserted against, such Contributor by reason
173
+ of your accepting any such warranty or additional liability.
174
+
175
+ END OF TERMS AND CONDITIONS
176
+
177
+ APPENDIX: How to apply the Apache License to your work.
178
+
179
+ To apply the Apache License to your work, attach the following
180
+ boilerplate notice, with the fields enclosed by brackets "[]"
181
+ replaced with your own identifying information. (Don't include
182
+ the brackets!) The text should be enclosed in the appropriate
183
+ comment syntax for the file format. We also recommend that you
184
+ install the file accompanying this file and include a README.md
185
+ file at the same time.
186
+
187
+ Copyright 2026 RUST_REWORK Contributors
188
+
189
+ Licensed under the Apache License, Version 2.0 (the "License");
190
+ you may not use this file except in compliance with the License.
191
+ You may obtain a copy of the License at
192
+
193
+ http://www.apache.org/licenses/LICENSE-2.0
194
+
195
+ Unless required by applicable law or agreed to in writing, software
196
+ distributed under the License is distributed on an "AS IS" BASIS,
197
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
198
+ See the License for the specific language governing permissions and
199
+ limitations under the License.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 RUST_REWORK Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.