Metadata-Version: 2.1
Name: sftpretty
Version: 1.0.4
Summary: Pretty secure file transfer made easy.
Home-page: https://github.com/byteskeptical/sftpretty
Download-URL: https://pypi.python.org/pypi/sftpretty
Author: byteskeptical
Author-email: 40208858+byteskeptical@users.noreply.github.com
License: BSD
Keywords: ftp scp sftp ssh
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Description-Content-Type: text/x-rst
License-File: LICENSE

sftpretty
=========

A pretty quick and simple interface to paramiko SFTP. Provides multi-threaded
routines with progress notifications for reliable, asynchronous transfers. This
is a Python3 optimized fork of pysftp with additional features & improvements.

* Built-in retry decorator
* Hash function for integrity checking
* Improved local & remote directory mapping
* Improved logging mechanism
* More tests
* Multi-threaded directory transfers
* Progress notifications
* Support for ciphers, digests, disabled algorithms, kex & key type connection options
* Support for ED25519 & ECDSA keys
* Support for private key passwords
* Thread-safe connection manager


Example
-------
.. code-block:: python

    from sftpretty import Connection


    # Basic

    with Connection('hostname', username='me', password='secret') as sftp:
        # Temporarily chdir to public/.
        with sftp.cd('public'):
            # Upload file to public/ on remote.
            sftp.put('/my/local/filename')
            # Download a remote file from public/.
            sftp.get('remote_file')


    with Connection('hostname', private_key='~/.ssh/id_ed25519',
                                private_key_pass='secret') as sftp:
        # Upload local directory to remote_directory.
        sftp.put_d('/my/local', '/remote_directory')

        # Recursively download a remote_directory and save it to /tmp locally.
        sftp.get_r('remote_directory', '/tmp')


    # Advanced

    with Connection('hostname', username='me', password='secret') as sftp:
        # Upload local directory to remote_directory. On occurance of any
        # exception or child of, passed in the tuple, retry the operation.
        # Between each attempt increment a pause equal to backoff * delay.
        # Run a total of tries (six) times including the first attempt.
        sftp.put_d('/my/local', '/remote_directory',
                   exceptions=(NoValidConnectionsError,
                               socket.timeout,
                               SSHException),
                   tries=6, backoff=2, delay=1)


    with Connection('hostname', private_key='~/.ssh/id_ed25519',
                                private_key_pass='secret') as sftp:
        # Recursively download a remote_directory and save it to /tmp locally.
        # Don't confirm files, useful in a scenario where the server removes
        # the remote file immediately after download. Preserve remote mtime on
        # local copy
        sftp.get_r('remote_directory', '/tmp', confirm=False,
                   preserve_mtime=True)


Additional Information
----------------------
* Project: https://github.com/byteskeptical/sftpretty
* Download: https://pypi.python.org/pypi/sftpretty
* Documentation: https://sftpretty.rtfd.org
* License: BSD

Requirements
------------
paramiko >= 1.17.0

Supports
--------
Tested on Python 3.6, 3.7, 3.8, 3.9, 3.10


Change Log
==========

1.0.4 (current, released 2022-09-24)
------------------------------------
    * added Windows Pure Path logic in put_d() and put_r() through localtree()
    * fix for regression in _sftp_channel() causing UnboundLocalError
    * improved support for dot notation in known_hosts and private key file
    * removed basicConfig() call for improved embedded behavior

1.0.3 (released 2022-09-13)
---------------------------
    * added disabled algorithms Connection option for transport

1.0.2 (released 2022-09-09)
---------------------------
    * bug fix for typo in put_d()
    * added sort to localtree() for test continuity

1.0.1 (released 2022-07-22)
---------------------------
    * added key types Connection option for transport
    * bug fixes for close()
    * default to private key authentication
    * enabled timeout setting for channel and transport
    * improved host key logging
    * localtree & remotetree functions Windows compatible
    * started hosting on PyPi
    * updated tests and CI pipeline 

1.0.0 (released 2021-06-06)
---------------------------
    * added ECDSA and ED25519 key support for authentication
    * added digest and kex Connection options for transport
    * added tests for additional functionality
    * default callback function for progress notifications
    * hash function added to helpers for file verification option
    * improved local and remote directory mapping
    * improved logging capabilities
    * replaced _sftp_connect with context aware channel manager
    * retry decorator for automated recovery from failure
    * switched to using pathlib for all local filepath operations
    * updated documentation and README with advanced examples
