core.network.ftp
- core.network.ftp.ftp_download(ftp: FTP, file_local: Path, dir_server: str | Path, verbose=True)[source]
Downloads file_local on ftp, from server directory dir_server
The file name on the server is determined by file_local.name
Example
ftp = FTP(**get_auth_ftp(‘my_server’)) local_file = Path(‘./data.txt’) ftp_download(ftp, local_file, ‘/remote/folder’) ftp.quit()
- core.network.ftp.ftp_list(ftp: FTP, dir_server: str, pattern: str = '*')[source]
Returns the list of fles matching pattern on dir_server
- core.network.ftp.ftp_upload(ftp: FTP, file_local: Path, dir_server: str, if_exists='skip', blocksize=8192, verbose=True)[source]
FTP upload function
Use temporary files
Create remote directories
- if_exists:
‘skip’: skip the existing file ‘error’: raise an error on existing file ‘overwrite’: overwrite existing file