mfatsftp 0.3.0__py3-none-any.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.
- mfatsftp/__init__.py +54 -0
- mfatsftp/client.py +2614 -0
- mfatsftp/protocol.py +473 -0
- mfatsftp/py.typed +0 -0
- mfatsftp/transport.py +270 -0
- mfatsftp-0.3.0.dist-info/METADATA +420 -0
- mfatsftp-0.3.0.dist-info/RECORD +9 -0
- mfatsftp-0.3.0.dist-info/WHEEL +4 -0
- mfatsftp-0.3.0.dist-info/licenses/LICENSE +675 -0
mfatsftp/__init__.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""mfatsftp — pure-Python SFTP that speaks through your system OpenSSH.
|
|
2
|
+
|
|
3
|
+
mfatsftp implements the SFTP v3 application protocol and uses the local ``ssh``
|
|
4
|
+
binary as its transport (``ssh -s <host> sftp``). It therefore inherits every
|
|
5
|
+
cipher, key exchange, ``~/.ssh/config`` setting, ProxyJump, certificate, agent
|
|
6
|
+
and askpass behaviour that your OpenSSH supports — with no crypto to maintain.
|
|
7
|
+
|
|
8
|
+
Requires the ``ssh`` binary at runtime. It is an SFTP client only (no exec, no
|
|
9
|
+
port forwarding, no server side).
|
|
10
|
+
|
|
11
|
+
Quickstart::
|
|
12
|
+
|
|
13
|
+
import mfatsftp
|
|
14
|
+
|
|
15
|
+
with mfatsftp.connect("user@host") as sftp:
|
|
16
|
+
for attr in sftp.listdir_attr("."):
|
|
17
|
+
print(attr.filename, attr.st_size)
|
|
18
|
+
sftp.get("/etc/hostname", "hostname.txt")
|
|
19
|
+
|
|
20
|
+
See the README for the full guide and API reference.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from .client import AtomicUploadItem, PipelinedWriter, ProgressCallback, SFTPClient, SFTPFile
|
|
24
|
+
from .protocol import (
|
|
25
|
+
SFTPAttributes,
|
|
26
|
+
SFTPConnectionError,
|
|
27
|
+
SFTPError,
|
|
28
|
+
SFTPNoSuchFileError,
|
|
29
|
+
SFTPPermissionError,
|
|
30
|
+
SFTPStatVFS,
|
|
31
|
+
SFTPTimeoutError,
|
|
32
|
+
)
|
|
33
|
+
from .transport import build_ssh_argv, connect, from_command
|
|
34
|
+
|
|
35
|
+
__all__ = [
|
|
36
|
+
"connect",
|
|
37
|
+
"from_command",
|
|
38
|
+
"build_ssh_argv",
|
|
39
|
+
"SFTPClient",
|
|
40
|
+
"SFTPFile",
|
|
41
|
+
"SFTPAttributes",
|
|
42
|
+
"SFTPStatVFS",
|
|
43
|
+
"SFTPError",
|
|
44
|
+
"SFTPNoSuchFileError",
|
|
45
|
+
"SFTPPermissionError",
|
|
46
|
+
"SFTPConnectionError",
|
|
47
|
+
"SFTPTimeoutError",
|
|
48
|
+
"AtomicUploadItem",
|
|
49
|
+
"PipelinedWriter",
|
|
50
|
+
"ProgressCallback",
|
|
51
|
+
"__version__",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
__version__ = "0.3.0"
|