:py:mod:`astronomer.providers.sftp.hooks.sftp` ============================================== .. py:module:: astronomer.providers.sftp.hooks.sftp Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: astronomer.providers.sftp.hooks.sftp.SFTPHookAsync .. py:class:: SFTPHookAsync(sftp_conn_id = default_conn_name, host = '', port = 22, username = '', password = '', known_hosts = default_known_hosts, key_file = '', passphrase = '', private_key = '') Bases: :py:obj:`airflow.hooks.base.BaseHook` This class is deprecated and will be removed in 2.0.0. Use :class: `~airflow.providers.sftp.hooks.sftp.SFTPHookAsync` instead. .. py:attribute:: conn_name_attr :value: 'ssh_conn_id' .. py:attribute:: default_conn_name :value: 'sftp_default' .. py:attribute:: conn_type :value: 'sftp' .. py:attribute:: hook_name :value: 'SFTP' .. py:attribute:: default_known_hosts :value: '~/.ssh/known_hosts' .. py:method:: list_directory(path = '') :async: Returns a list of files on the SFTP server at the provided path .. py:method:: read_directory(path = '') :async: Returns a list of files along with their attributes on the SFTP server at the provided path .. py:method:: get_files_and_attrs_by_pattern(path = '', fnmatch_pattern = '') :async: Returns the files along with their attributes matching the file pattern (e.g. ``*.pdf``) at the provided path, if one exists. Otherwise, raises an AirflowException to be handled upstream for deferring .. py:method:: get_files_by_pattern(path = '', fnmatch_pattern = '') :async: Returns the name of a file matching the file pattern at the provided path, if one exists Otherwise, raises an AirflowException to be handled upstream for deferring .. py:method:: get_mod_time(path) :async: Makes SFTP async connection and looks for last modified time in the specific file path and returns last modification time for the file path. :param path: full path to the remote file