Module iaf.io.utils

Utility functions.

Functions

def download_file(url: str, target_dir: Union[pathlib.Path, str] = None, local_filename: str = None) ‑> pathlib.Path

Download a file from given URL to target folder and filename.

Parameters

url : str
URL of the file to dowload.
target_dir : str
Full path where to download the file. If omitted, it will fall back to current path.
local_filename : str
Local name of the downloaded file. If omitted, the file name will be extracted from the URL.

Adapted from: https://stackoverflow.com/questions/16694907/download-large-file-in-python-with-requests.