Durable SFTP connections
Project description
DuraSFTP
A durable extension the pysftp SFTP client: https://pysftp.readthedocs.io/
Installation
pip install durasftp
Command Line Usage
Show the help:
python -m durasftp --help
Mirror an SFTP endpoint to your local with private keys:
python -m durasftp --host some.sftp.server.com --port 22 --username your_username \
--private-key ~/.ssh/id_rsa --private-key-pass 'ULTRASECUREPASSWORD' \
--local-base /tmp/local_copy_of_server
Mirror an SFTP endpoint to your local with a password:
python -m durasftp --host some.sftp.server.com --port 22 --username your_username \
--password 'ULTRASECUREPASSWORD' \
--local-base /tmp/local_copy_of_server
Package Usage
This package very closely mirrors the functionality of pysftp, except it automatically recovers a connection in the event that network connectivity is intermittent.
It also introduces a mirroring functionality, where you can copy a local directory to a remote server, or copy a remote directory to the local. It will ignore files that already exist on the destination, if the file size and modification time are identical.
Basic Usage
The DurableSFTPConnection class is intended to be a drop-in replacement for the pysftp.Connection class. With a stable network connection, it should be identical in every way.
from durasftp import DurableSFTPConnection
conn = DurableSFTPConnection(host="some.sftp.server.com", port=22, username="your_username", password="ULTRASECUREPASSWORD")
conn.listdir('/')
Mirror from remote server to local
from durasftp import Mirrorer
mirrorer = Mirrorer(
local_base="/tmp/local_copy_of_server",
host="some.sftp.server.com",
port=22,
username="your_username",
password="ULTRASECUREPASSWORD",
timeout=3,
)
mirrorer.mirror_from_remote(dry_run=True)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file durasftp-1.0.0.tar.gz
.
File metadata
- Download URL: durasftp-1.0.0.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b31a3e8209c770a1ef5de5e814e1a6f918f807c80dfca9bc988cb3cb61c2ef1a |
|
MD5 | 79efcea13074c9629dc95b227d667a1e |
|
BLAKE2b-256 | 08755469f87d660dbfaac64dfd40d2de6ae4610ce5e2f217e637a2f95d8a9282 |
File details
Details for the file durasftp-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: durasftp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53f960caec1610154b4da270148bbc3687cf4c2f77fb33270a624ad25e0943c6 |
|
MD5 | 7014bda22420708969c77866e8075e25 |
|
BLAKE2b-256 | fb3ff136d1549339438c4cd41e36b94d8b4fb7c9ce8f613601caad04eb2f0f79 |