| Version 5 (modified by anonymous, 7 years ago) (diff) |
|---|
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.path.walk works. :-) But slow. ;-)
Note: The links after this paragraph don't work yet; I'm just building this website.
Follow this link for the current ftputil website.
The documentation is here.
From these pages, you find:
- Documentation
- Download page
- SourceRepository
- MailingList (hosted by Codespeak, thanks Holger)
- IssueTracker (you can view summary lists of tickets or enter new tickets for bugs or enhancement requests)
This website is built with Trac, an open-source wiki, issue tracker and Subversion repository browser.
