Alternatives to Python's ftplib?

ftp, python

Solution

I think pycURL would be one of your best options. I have found another question on this site from a while back that agrees to this. The question is not exactly the same as yours, but maybe it will help you out.

Here is the link to that question: Python Libraries for FTP Upload/Download?

Problem

I'm looking for an alternative to python's ftplib, for speed purposes. When performing FTP uploads, python's ftplib.FTP.storbinary does sequential read to memory then send to server, in chunks of a specified block size, until the file is uploaded. Because of this, it's simply not very fast. Ideally a thread would constantly be reading at least one block size ahead, and another thread would always be sending the block already in memory. The speed of python itself could also be a factor, but in any case Ubuntu's native FTP client (command line) uploads ~60% faster. I had considered using Ubuntu's native FTP client through a python subprocess, but I really want the callback feature supported by ftplib to update the upload progress of a single file every block size (calls a python function pointer after each block is sent). Additionally, it's a little tricky to call Ubuntu's native FTP client from python, since it's intended to be interactive. So...does anyone have any suggestions for an FTP client in python that supports a callback feature and is faster than python's ftplib? I'm open to compiled C/C++ libraries that are already setup with a python wrapper. Edit: I just came across pycurl, which may fit the bill. Somehow didn't see that one before. Still happy to hear other suggestions!

Original source