Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a uniform python library to transfer files using different protocols

I know there is ftplib for ftp, shutil for local files, what about NFS? I know urllib2 can get files via HTTP/HTTPS/FTP/FTPS, but it can't put files.

If there is a uniform library that automatically detects the protocol (FTP/NFS/LOCAL) with URI and deals with file transfer (get/put) transparently, it's even better, does it exist?

like image 433
btw0 Avatar asked Sep 18 '25 19:09

btw0


1 Answers

You want to look up and use pycurl/libcurl. Libcurl: http://curl.haxx.se/ PyCurl: http://pycurl.sourceforge.net/ - curl supports the http://, file://, and ftp:// uris. I have used it with much success.

like image 159
jnoller Avatar answered Sep 20 '25 09:09

jnoller