bsrn.io.retrieval.download_bsrn_files#
- bsrn.io.retrieval.download_bsrn_files(filenames, local_dir, username, password, host='ftp.bsrn.awi.de', retries=3)[source]#
Download many BSRN files efficiently using a single FTP connection with robust retries. 使用单个 FTP 连接高效地下载多个 BSRN 文件,并带有稳健的重试机制。
- Parameters:
filenames (list of str) – List of filenames to download (e.g., [‘pay0123.dat.gz’]). 要下载的文件名列表(例如 [‘pay0123.dat.gz’])。
local_dir (str) – The local directory to save the files. 保存文件的本地目录。
username (str) – BSRN FTP username. BSRN FTP 用户名。
password (str) – BSRN FTP password. BSRN FTP 密码。
host (str, default BSRN_FTP_HOST) – FTP host address. FTP 主机地址。
retries (int, default 3) – Number of retry attempts for both connection and file transfer errors. 连接和文件传输错误的重试次数。
- Returns:
downloaded_paths – List of paths to the downloaded files. 已下载文件的路径列表。
- Return type: