:py:mod:`wolfhece.ftp.downloader` ================================= .. py:module:: wolfhece.ftp.downloader Module Contents --------------- .. py:function:: _is_ftp_dir(ftp_handle, name, guess_by_extension=True) simply determines if an item listed on the ftp server is a valid directory or not .. py:function:: _make_parent_dir(fpath) ensures the parent directory of a filepath exists .. py:function:: _download_ftp_file(ftp_handle, name, dest, overwrite) downloads a single file from an ftp server .. py:function:: _file_name_match_patern(pattern, name) returns True if filename matches the pattern .. py:function:: _mirror_ftp_dir(ftp_handle, name, overwrite, guess_by_extension, pattern) replicates a directory on an ftp server recursively .. py:function:: download_ftp_tree(ftp_handle, path, destination, pattern=None, overwrite=False, guess_by_extension=True) Downloads an entire directory tree from an ftp server to the local destination :param ftp_handle: an authenticated ftplib.FTP instance :param path: the folder on the ftp server to download :param destination: the local directory to store the copied folder :param pattern: Python regex pattern, only files that match this pattern will be downloaded. :param overwrite: set to True to force re-download of all files, even if they appear to exist already :param guess_by_extension: It takes a while to explicitly check if every item is a directory or a file. If this flag is set to True, it will assume any file ending with a three character extension ".???" is a file and not a directory. Set to False if some folders may have a "." in their names -4th position. .. py:data:: mysite :value: 'some_ftp_site'