download_file#

ProjectApi.download_file(file, target_path, progress_handler=None, file_name=None, **kwargs)#

Download file content and save it to disk.

Return type:

str

Parameters:
fileFile

File object to download.

target_pathstr

Path to the directory where to save the file.

progress_handlerCallable[[int], None], optional

Function to handle progress updates. The default is None. The function should accept a single argument, which is the current size of the downloaded file in bytes.

file_namestr, optional

Name of the file to save. If None, the original file name is used.

kwargsdict, optional

Additional arguments to pass to the download function. The ‘stream’ argument is deprecated and should not be used.

Returns:
str

Path to the downloaded file.