A pretty, simple SFTP wrapper around paramiko with a high-level API for secure file transfer. Current version is 1.2.1, requires Python >=3.6. Release cadence is occasional, with recent releases roughly every few months.
pip install sftprettyVerified import paths — ran on the pinned version, not inferred.
Basic connection and directory listing. Disables host key verification for simplicity; use proper hostkeys in production.
Review paramiko's license implications before incorporating into proprietary software.
Perform all file operations inside the with block.
from sftpretty import CnOpts; cnopts = CnOpts(); Connection(..., cnopts=cnopts)
Load known hosts file with cnopts.hostkeys.load('path/to/known_hosts') or set cnopts.hostkeys = None for testing only.Change imports to `from sftpretty import Connection` and use `Connection(...)` directly.
from sftpretty import Connection
Use `from sftpretty import CnOpts`; ensure sftpretty version >=1.0.0.
Either disable host key checking (cnopts.hostkeys = None) or load the known_hosts file with cnopts.hostkeys.load('path/to/known_hosts').Use connection = Connection('example.com:22', username='user', password='pass') or separate port argument? Actually sftpretty does accept port as an integer argument in version 1.2.x. Check docs. If error persists, use host:port format.