SFTP using paramiko
While custom-written RESTful web APIs may be common with large companies and third-party services, our programs are often called upon to exchange files or data with servers using standard communication protocols. In the Linux and Unix world, the secure shell or SSH protocol has long been the de-facto standard for communication between systems. Most implementations of SSH include SFTP (Secure File Transfer Protocol), an encrypted replacement for the archaic FTP service.
In addition to uploading the CSV extract to the corporate REST service, your manager has to upload a second copy to a remote server using SFTP. The user workflow needs to be the same, though there is a requirement to upload the file into a particular directory on the server. You need to implement this upload in your application just as you did for the REST service.
Setting up SSH services for testing
In order to test the SFTP features we're going to code in our application, we need...