{"library":"pysftp","title":"PySFTP","description":"PySFTP is a Python library that provides a simplified, high-level interface for Secure File Transfer Protocol (SFTP) operations. It acts as a wrapper around the lower-level Paramiko library, aiming to make common SFTP tasks more approachable. The current version, 0.2.9, was released in July 2016, and the project appears to be unmaintained with no new releases since then.","language":"python","status":"abandoned","last_verified":"Sat May 16","install":{"commands":["pip install pysftp"],"cli":null},"imports":["from pysftp import Connection"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pysftp\nimport os\n\n# It is highly recommended to NOT disable host key checking in production.\n# For proper security, manage known_hosts or explicitly add server keys.\ncnopts = pysftp.CnOpts()\n# !!! In production, configure hostkeys properly. DO NOT SET TO NONE. !!!\n# For demonstration, we disable it here for easier local testing. \ncnopts.hostkeys = None \n\nHOSTNAME = os.environ.get('SFTP_HOSTNAME', 'sftp.example.com')\nUSERNAME = os.environ.get('SFTP_USERNAME', 'user')\nPASSWORD = os.environ.get('SFTP_PASSWORD', 'secret_password')\n\ntry:\n    with pysftp.Connection(host=HOSTNAME, username=USERNAME, password=PASSWORD, cnopts=cnopts) as sftp:\n        print(f\"Connection successfully established with {HOSTNAME}!\")\n        print(f\"Current remote directory: {sftp.pwd}\")\n\n        # Example: Upload a file\n        local_file = 'local_test_file.txt'\n        remote_path = f'/remote/{local_file}'\n        with open(local_file, 'w') as f:\n            f.write('Hello, SFTP World!')\n\n        sftp.put(local_file, remote_path)\n        print(f\"Uploaded {local_file} to {remote_path}\")\n\n        # Example: Download a file\n        downloaded_file = 'downloaded_test_file.txt'\n        sftp.get(remote_path, downloaded_file)\n        print(f\"Downloaded {remote_path} to {downloaded_file}\")\n\n        # Example: List remote directory\n        print(f\"Files in remote directory {sftp.pwd}:\")\n        for entry in sftp.listdir():\n            print(f\"- {entry}\")\n\nexcept pysftp.ConnectionException as e:\n    print(f\"SFTP connection failed: {e}\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")\nfinally:\n    # Clean up local test file if it was created\n    if os.path.exists(local_file):\n        os.remove(local_file)\n    if os.path.exists(downloaded_file):\n        os.remove(downloaded_file)\n","lang":"python","description":"This quickstart demonstrates how to establish an SFTP connection using `pysftp.Connection` with a context manager, upload a local file, download a remote file, and list the contents of the current remote directory. It highlights the importance of host key verification, showing a common (but insecure for production) method to disable it for testing purposes. Credentials are retrieved from environment variables for security.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"0.2.9","pypi_latest":"0.2.9","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":3.7,"avg_import_s":null,"wheel_type":"sdist"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pysftp","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"43.3M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pysftp","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":3.5,"import_time_s":null,"mem_mb":null,"disk_size":"44M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pysftp","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"46.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pysftp","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":3.2,"import_time_s":null,"mem_mb":null,"disk_size":"47M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pysftp","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"36.3M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pysftp","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":3.9,"import_time_s":null,"mem_mb":null,"disk_size":"37M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pysftp","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"36.0M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pysftp","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":3.8,"import_time_s":null,"mem_mb":null,"disk_size":"36M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pysftp","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"43.7M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pysftp","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"broken","install_time_s":4,"import_time_s":null,"mem_mb":null,"disk_size":"44M"}]}}