Skip to main content
download_files(file_names=None, read_offsets=None, read_lengths=None, options=)[source]

Downloads one or more files from KiFS.

Parameters

file_names (list of str) –

An array of the file names to download from KiFS. File paths may contain wildcard characters after the KiFS directory delimiter.

Accepted wildcard characters are asterisk (*) to represent any string of zero or more characters, and question mark (?) to indicate a single character. The user can provide a single element (which will be automatically promoted to a list internally) or a list.

read_offsets (list of longs) –

An array of starting byte offsets from which to read each respective file in input parameter file_names. Must either be empty or the same length as input parameter file_names. If empty, files are downloaded in their entirety. If not empty, input parameter read_lengths must also not be empty. The user can provide a single element (which will be automatically promoted to a list internally) or a list.

read_lengths (list of longs) –

Array of number of bytes to read from each respective file in input parameter file_names. Must either be empty or the same length as input parameter file_names. If empty, files are downloaded in their entirety. If not empty, input parameter read_offsets must also not be empty. The user can provide a single element (which will be automatically promoted to a list internally) or a list.

options (dict of str to str) –

Optional parameters. Allowed keys are:

  • file_encoding – Encoding to be applied to the output file data. When using JSON serialization it is recommended to specify this as base64. Allowed values are:

    • base64 – Apply base64 encoding to the output file data.

    • none – Do not apply any encoding to the output file data.

    The default value is ‘none’.

The default value is an empty dict ( ).

Returns

A dict with the following entries–

file_names (list of str) –

Names of the files downloaded from KiFS.

file_data (list of bytes) –

Data for the respective downloaded files listed in output parameter file_names.

info (dict of str to str) –

Additional information.