download_file, cache=False, show_progress=True, timeout=None)[source]

Accepts a URL, downloads and optionally caches the result returning the filename, with a name determined by the file’s MD5 hash. If cache=True and the file is present in the cache, just returns the filename.


The URL of the file to download

cachebool, optional

Whether to use the cache

show_progressbool, optional

Whether to display a progress bar during the download (default is True). Regardless of this setting, the progress bar is only displayed when outputting to a terminal.

timeoutfloat, optional

The timeout, in seconds. Otherwise, use


Returns the local path that the file was download to.

urllib2.URLError, urllib.error.URLError

Whenever there’s a problem getting the remote file.