Simple Username/Password based SFTP Client.
sftpclient is a simple to use sftp client to connect to remote FTP servers over ssh (SFTP) using username/password combo.
Uploads and downloads work with file-handles by default so as to not fill up the working directory with downloaded files when the desire was just to read and parse the data available at the remote server.
Default downloads are in bytes mode mode=rb, use an io.TextIOWrapper to read the file as text.
Sample usage
from sftpclient import SFTPClient
# create client instance.
client = SFTPClient(
host=SFTPHOST,
username=YOURSFTPUSERNAME,
password=YOURSFTPPASSWORD,
use_known_hosts=UPTOYOUTODECIDE,
)
# Uploading files;
# 1. open a file (or use a `tempfile.TemporaryFile`).
with open('somefile') as file_to_upload:
# 2. use the `SFTPClient` `upload` method to pass the open file handle to
# the remote `destination`.
client.upload(file_to_upload, destination='/uploads')
# Downloading files;
file = client.download('/data/consume.txt', text=True)
# use `text=True` when downloading text files, default is `bytes` mode.
for line in file:
# continue with processing the file as desired, or just write it out to
# local disk.
Release files for sftpclient 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sftpclient-1.0.0.tar.gz | 2.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sftpclient-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.0 kB
Release files / sftpclient-1.0.0.tar.gz
| Download URL | sftpclient-1.0.0.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5ba0a1a0f0917beb48d606ae58d963d447883062668e82479d351f112bbce10
|
|
BLAKE2b-256 checksum How to use checksums |
c97e212f8986790e98141900bc08b2a64e57adaedfd87378edb11e0378757bbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
|
Release files / sftpclient-1.0.0-py3-none-any.whl
| Download URL | sftpclient-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eb35e1ab87d1b0f17ac9f479f7f714852ee82f470c95a80af43ae439574a6474
|
|
BLAKE2b-256 checksum How to use checksums |
48b3b83faec27495999eeb26be194fe05f7bd986430fbf128c5701ab5d75df9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
|