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.

Returns
local_filestr

Name of local file or None if failed to parse url

statusint

Bit flag of results: 1 == file found, 2 = download successful