fetch_s3_url¶
- grizli.utils.fetch_s3_url(url='s3://bucket/path/to/file.txt', file_func=<function <lambda>>, skip_existing=True, verbose=True)[source]¶
Fetch file from an S3 bucket
- Parameters
- urlstr
S3 url of a file to download
- file_funcfunction
Function applied to the file name extracted from
url
, e.g., to set output directory, rename files, set a prefix, etc.- skip_existingbool, optional
If True, skip downloading if the local file already exists. Default is True.
- verbosebool, optional
If True, print download progress and status messages. Default is True.
- Returns
- local_filestr
Name of local file or
None
if failed to parseurl
- statusint
Bit flag of results: 1 == file found, 2 = download successful