FileDownloader¶
- class gdt.core.heasarc.FileDownloader(progress: Progress = None, timeout: float = 90.0)[source]¶
Bases:
AbstractContextManagerUsed to download a list of files given as a URL.
- Parameters:
progress (Progress, optional) – The progress bar object
timeout (int, optional) – Seconds to wait before timing out operations.
Methods Summary
bulk_download(urls, dest_dir[, verbose])Download files from a list of URLs.
download_url(url, dest_dir[, verbose])Download a file from a URL.
Methods Documentation
- bulk_download(urls: List[str], dest_dir: Union[str, Path], verbose: bool = True)[source]¶
Download files from a list of URLs.
- Parameters:
urls (list of str) – The urls of files to download
dest_dir (str, Path) – The directory where the file will be written
verbose (bool, optional) – If True, will output the download status. Default is True.
- Returns:
(list) – File path list
- download_url(url: str, dest_dir: Union[str, Path], verbose: bool = True)[source]¶
Download a file from a URL.
- Parameters:
url (str) – The url of a file to download
dest_dir (str, Path) – The directory where the file will be written
verbose (bool, optional) – If True, will output the download status. Default is True.
- Returns:
(Path)