bundles / astropy latest / astropy / utils / data / download_files_in_parallel
function
astropy.utils.data:download_files_in_parallel
source: /astropy/utils/data.py :1642
Signature
def download_files_in_parallel ( urls , cache = update , show_progress = True , timeout = None , sources = None , multiprocessing_start_method = None , pkgname = astropy ) Summary
Download multiple files in parallel from the given URLs.
Extended Summary
Blocks until all files have downloaded. The result is a list of local file paths corresponding to the given urls.
The results will be stored in the cache under the values in urls even if they are obtained from some other location via sources. See ~download_file for details.
Parameters
urls: list of strThe URLs to retrieve.
cache: bool or "update", optionalWhether to use the cache (default is
True). If "update", always download the remote URLs to see if new data is available and store the result in cache.show_progress: bool, optionalWhether to display a progress bar during the download (default is
True)timeout: float, optionalTimeout for each individual requests in seconds (default is the configurable
astropy.utils.data.Conf.remote_timeout).sources: dict, optionalIf provided, for each URL a list of URLs to try to obtain the file from. The result will be stored under the original URL. For any URL in this dictionary, the original URL will not be tried unless it is in this list; this is to prevent long waits for a primary server that is known to be inaccessible at the moment.
multiprocessing_start_method: str, optionalUseful primarily for testing; if in doubt leave it as the default. When using multiprocessing, certain anomalies occur when starting processes with the "spawn" method (the only option on Windows); other anomalies occur with the "fork" method (the default on Linux).
pkgname: `str`, optionalThe package name to use to locate the download cache. i.e. for
pkgname='astropy'the default cache location is~/.astropy/cache.
Returns
paths: list of strThe local file paths corresponding to the downloaded URLs.
Notes
If a URL is unreachable, the downloading will grind to a halt and the exception will propagate upward, but an unpredictable number of files will have been successfully downloaded and will remain in the cache.
Aliases
-
astropy.utils.data.download_files_in_parallel