Welcome to pysftp’s documentation!

A simple interface to sftp. based on zeth’s ssh.py


import pysftp

with pysftp.Connection('hostname', username='me', password='secret') as sftp:
    with sftp.cd('public')              # temporarily chdir to public
        sftp.put('/my/local/filename')  # upload file to public/ on remote

    sftp.get_r('myfiles', '/backup')    # recursively copy myfiles/ to local


Tested on Python 2.7, 3.2, 3.3

Build Status

Believed to support Python 3.4

Additional Information

Indices and tables