url_files_download¶
-
cosmo_utils.utils.web_utils.
url_files_download
(url, ext, outdir, check_exist=False, create_dir=False, remove_files=False, bar_opt='tqdm')[source] [edit on github]¶ Downloads the files from a URL to a local directory. The files that match a specific file extension,
ext
.Parameters: url :
str
String of the URL
ext :
str
File extension of the files in the URL.
outdir :
str
Path to the output directory. This is the directory, to which the files with extensions
ext
will be saved.check_exist :
bool
, optionalcreate_dir :
bool
, optionalremove_files :
bool
, optionalIf
True
, local files that are present that match the files at the URL will be replaced by the new versions. This variable is set toFalse
by default.bar_opt : {‘tqdm’, ‘native’}
Option for which type of progress bar to use when downloading files. This variable is set to
tqdm
by default. Options:- ‘tqdm’ : Uses a tqdm-based progress bar
- ‘native’: Used the wget-based native progress bar.