Package: pyftpdlib-ustcblog
Quick linksHomeDocumentationDownloadBlogMailing listWhat’s newAboutPython FTP server library provides a high-level portable interface to easily
write very efficient, scalable and asynchronous FTP servers with Python. It is
the most completeRFC-959FTP server
implementation available forPythonprogramming
language and it’s used in projects likeGoogle ChromiumandBazaarand included inDebian,FedoraandFreeBSDpackage repositories.FeaturesExtremelylightweight,fastandscalable(seewhyandbenchmarks).Usessendfile(2)(seepysendfile)
system call for uploads.Uses epoll() / kqueue() / select() to handle concurrency asynchronously.…But can optionally skip to amultiple thread / processmodel (as in: you’ll be free to block or use slow filesystems).Portable: entirely written in pure Python; works with Python from2.4to3.4(by using a single code base).SupportsFTPS(RFC-4217),IPv6(RFC-2428),Unicodefile names (RFC-2640),MLSD/MLSTcommands (RFC-3659).Support for virtual users and virtual filesystem.Extremely flexible system of “authorizers” able to manage both “virtual” and
“real” users on on bothUNIXandWindows.Test coverageclose to 100%.PerformancesDepite being written in an intepreted language, pyftpdlib has transfer rates
superior to most common UNIX FTP servers. It also scales better since whereas
vsftpd and proftpd use multiple processes to achieve concurrency, pyftpdlib
will only use one process and handle concurrency asynchronously (seethe C10K problem). Here are somebenchmarksmade against my Linux 3.0.0 box, Intel core-duo 3.1 Ghz:pyftpdlib vs. proftpd 1.3.4benchmark typepyftpdlibproftpdspeedupSTOR (client -> server)585.90 MB/sec600.49 MB/sec-0.02xRETR (server -> client)1652.72 MB/sec1524.05 MB/sec+0.08300 concurrent clients (connect, login)0.19 secs9.98 secs+51xSTOR (1 file with 300 idle clients)585.59 MB/sec518.55 MB/sec+0.1xRETR (1 file with 300 idle clients)1497.58 MB/sec1478.19 MB/sec0x300 concurrent clients (RETR 10M file)3.41 secs3.60 secs+0.05x300 concurrent clients (STOR 10M file)8.60 secs11.56 secs+0.3x300 concurrent clients (QUIT)0.03 secs0.39 secs+12xpyftpdlib vs. vsftpd 2.3.5benchmark typepyftpdlibproftpdspeedupSTOR (client -> server)585.90 MB/sec611.73 MB/sec-0.04xRETR (server -> client)1652.72 MB/sec1512.92 MB/sec+0.09300 concurrent clients (connect, login)0.19 secs20.39 secs+106xSTOR (1 file with 300 idle clients)585.59 MB/sec610.23 MB/sec-0.04xRETR (1 file with 300 idle clients)1497.58 MB/sec1493.01 MB/sec0x300 concurrent clients (RETR 10M file)3.41 secs3.67 secs+0.07x300 concurrent clients (STOR 10M file)8.60 secs9.82 secs+0.07x300 concurrent clients (QUIT)0.03 secs0.01 secs+0.14xFor more benchmarks seehere.Quick start>>>frompyftpdlib.authorizersimportDummyAuthorizer>>>frompyftpdlib.handlersimportFTPHandler>>>frompyftpdlib.serversimportFTPServer>>>>>>authorizer=DummyAuthorizer()>>>authorizer.add_user("user","12345","/home/giampaolo",perm="elradfmw")>>>authorizer.add_anonymous("/home/nobody")>>>>>>handler=FTPHandler>>>handler.authorizer=authorizer>>>>>>server=FTPServer(("127.0.0.1",21),handler)>>>server.serve_forever()[I13-02-1910:55:42]>>>startingFTPserveron127.0.0.1:21<<<[I13-02-1910:55:42]poller:<class'pyftpdlib.ioloop.Epoll'>[I13-02-1910:55:42]masquerade(NAT)address:None[I13-02-1910:55:42]passiveports:None[I13-02-1910:55:42]usesendfile(2):True[I13-02-1910:55:45]127.0.0.1:34178-[]FTPsessionopened(connect)[I13-02-1910:55:48]127.0.0.1:34178-[user]USER'user'loggedin.[I13-02-1910:56:27]127.0.0.1:34179-[user]RETR/home/giampaolo/.vimrccompleted=1bytes=1700seconds=0.001[I13-02-1910:56:39]127.0.0.1:34179-[user]FTPsessionclosed(disconnect).other code samplesDonateA lot of time and effort went into making pyftpdlib as it is right now.
If you feel pyftpdlib is useful to you or your business and want to support its
future development please consider donating me
(Giampaolo Rodola’) some money.
I only ask for a small donation, but of course I appreciate any amount.Don’t want to donate money? Then maybe you couldwrite me a recommendation on Linkedin.
In case you’re using pyftpdlib into a software of yoursmail meand I’ll add your
software to theadoptions list.Timeline2014-06-03: version1.4.0released.2014-04-12: version1.3.1released.2013-11-07: version1.3.0released.2013-04-22: version1.2.0released.2013-04-09: version1.1.0released.2013-02-22: version1.0.1released.2013-02-19: version1.0.0released.2012-05-14: pyftpdlib included inftp-cloudfsproject.2012-01-25: version0.7.0released.2011-12-01: pyftpdlib included infeitp-serverproject.2011-09-26: pyftpdlib included inftpmasterproject.2011-07-09: pyftpdlib included inbftpdproject.2011-07-09: pyftpdlib included infastersyncproject.2011-01-31: pyftpdlib included input.io FTP connector project.2011-01-24: version0.6.0released.2010-12-14: addeddonations.2010-08-24: pyftpdlib included inpeerscapeproject.2010-07-15: pyftpdlib included inFaetusproject.2010-07-11: pyftpdlib included inPyfilesystemproject.2010-06-28: pyftpdlib has beenpackaged for Debian2010-04-28: pyftpdlib included insierramoduleposproject.2010-03-20:http://www.smartfile.comuses pyftpdlib.2010-01-13: pyftpdlib included inzenftpproject.2009-12-26: pyftpdlib included inSymbian Python FTP serverproject.2009-11-04:www.netplay.ituses pyftpdlib.2009-11-04:www.adcast.tvuses pyftpdlib.2009-11-04:www.bitsontherun.comuses pyftpdlib.2009-11-02: pyftpdlib included inftp-cloudfsproject.2009-09-14: version0.5.2released.2009-08-10: pyftpdlib included inImgserveproject.2009-07-22: pyftpdlib included inPlumiproject.2009-04-02: pyftpdlib RPM-packaged and ported onFedorato make users can easily install on it viayum install pyftpdlib.2009-03-28: pyftpdlib included inBazaarproject.2009-02-23: pyftpdlib included inShareFTPproject.2009-01-21: version0.5.1released.2008-12-27: pyftpdlib included inGoogle Chromium, the open source project behindGoogle Chrome.2008-12-27: pyftpdlib ported onGNU Darwinsystems to make users can easily install on it.2008-11-26: pyftpdlib included inOpenERP.2008-10-26: pyftpdlib included inPython for OpenVMSas standard package.2008-10-09: pyftpdlib included inSharemeproject.2008-09-20: version0.5.0released.2008-08-10: pyftpdlib included inManentproject.2008-05-16: version0.4.0released.2008-04-09: pyftpdlib used as backend forgpftpd, an FTP server for managing files hosted onGoogle Pages.2008-01-17: version0.3.0released.2007-10-14: pyftpdlib included inAksyproject.2007-09-17: version0.2.0released.2007-09-08: pyftpdlib included asFarManagerplug-in.2007-03-06: pyftpdlibported on FreeBSDsystems to make users can easily install on it.2007-03-07: version0.1.1released.2007-02-26: version0.1.0released.2006-09-26: initial clunky thread-based progenitorlink.TrademarksSome famous trademarks which adopted pyftpdlib (complete list).