Is there a single python library for transferring files using different protocols

I know that for local files for ftp, shutilthere is ftplib, but what about NFS? I know that urllib2 can receive files via HTTP / HTTPS / FTP / FTPS, but it cannot put files.

If there is a single library that automatically detects the protocol (FTP / NFS / LOCAL) with a URI and transparently transfers file transfers (get / put), is it even better if it exists?

+3
source share
2 answers

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

+2
source

Take a look at KDE IOSlaves. They can control the entire protocol that you describe, plus several others (samba, ssh, ...).

You can create iOS devices via PyKDE or, if this dependency is too large, you can probably control ioslave from python using the subprocess module.

+1
source

Source: https://habr.com/ru/post/1709376/


All Articles