download_file

astropy.utils.data.download_file(remote_url, cache=False)[source] [edit on github]

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.

Parameters :

remote_url : str

The URL of the file to download

cache : bool, optional

Whether to use the cache

Returns :

local_path : str

Returns the local path that the file was download to.

Raises :

`urllib2.URLError` :

Whenever there’s a problem getting the remote file.

Page Contents