问题
I have a simple requirement to drop a file on an SFTP server. I have found pysftp and Paramiko libraries that seem to allow me to this and developed a simple application using Paramiko but I can't find a proper source that compares the two so I can decide which one I can/should use. What are the pros and cons for each?
回答1:
pysftp is a wrapper around Paramiko with a more Python-ish interface.
pysftp interface does not expose all of the features of Paramiko. On the other hand, pysftp implements more high-level features on top of Paramiko, notably recursive file transfers.
If you do not have any fancy low-level needs (like unusual methods of verifying host key, proxies, etc), use pysftp as it may be easier to work with.
If you need low-level features, use Paramiko.
If you need both, use Paramiko and check pysftp code for the high-level features.
来源:https://stackoverflow.com/questions/48434941/pysftp-vs-paramiko