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. Here are two examples:

# Download some files from the login directory.
with ftputil.FTPHost('', 'user', 'secret') as host:
    names = host.listdir(host.curdir)
    for name in names:
        if host.path.isfile(name):
            # Remote name, local name
  , name)

# Check if a remote text file contains "ftputil".
# Stop reading as soon as the string is found.
with host.file("some_file") as remote_fobj:
    for line in remote_fobj:
        if "ftputil" in line:
            found = True
        found = False

See the documentation for all the features.

Last modified 5 months ago Last modified on Oct 29, 2017, 10:18:30 AM