Python SFTP Automation via pexpect

via Freelancer ·

Budget / SalaryHourly project
TypeFreelance project
LocationRemote
Posted1 hour ago
I need a clean, well-documented Python 3 solution that drives the native sftp client through pexpect. The code must handle both uploading and downloading files, accepting host, port, user, key file or password, and path parameters at runtime. It should accept new file commands and based on the responses received. Target host is Windows, however, it should run on Linux and MacOS as well.

Robustness is essential. The script should watch for and gracefully recover from connection failures, file permission errors, and mid-transfer interruptions, retrying or exiting with clear messages and non-zero exit codes where appropriate.

Acceptance criteria:
• A single, self-contained .py file (or small package) using only the standard library plus pexpect
• Successful unattended transfer of sample files in both directions during test run
• Clear exception handling covering the failure scenarios listed above
• README and brief test that can be repeated elsewhere
python software development automation
Apply on Freelancer →

Project sourced from Freelancer.com. Applications happen directly on the original platform — we never collect your data.