ftputil - a high-level FTP client library for Python

The ftputil Python library is a high-level interface to the ftplib module. The FTPHost objects generated with ftputil allow many operations similar to those of os and os.path. An example:

# download some files from the login directory
host = ftputil.FTPHost('ftp.domain.com', 'user', 'secret')
names = host.listdir(host.curdir)
for name in names:
    if host.path.isfile(name):
        host.download(name, name, 'b')        # remote, local, binary mode

# make a new directory and copy a remote file into it
host.mkdir('newdir')
source = host.file('index.html', 'r')         # file-like object
target = host.file('newdir/index.html', 'w')  # file-like object
host.copyfileobj(source, target)              # similar to shutil.copyfileobj
source.close()
target.close()

Also, there's host.stat to request size and modification time of a file. Even host.walk works. :-)

On this website you find:

The website is built with Trac, an open-source wiki, issue tracker and Subversion repository browser.