[ANN] ftputil 1.0 - a higher level interface for FTP sessions

Stefan Schwarzer s.schwarzer@ndh.net
Tue, 22 Jan 2002 00:10:17 +0100

Hello Pythoneers :)

I would like to announce ftputil.py, a module which provides a
more friendly interface for FTP sessions than the ftplib module.

The FTPHost objects generated from it allow many operations similar
to those of os and os.path. Examples:

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

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

Even host.path.walk works. :-) But slow. ;-)

ftputil.py can be downloaded from

I would like to get your suggestions and comments. :-)


P.S.: Thanks to Pedro Rodriguez for his helpful answer to my question
in comp.lang.python :-)