Chapter 6. Downloading files from your bucket
To download a file from your bucket to your workbench, use the download_file() method.
Prerequisites
-
You have cloned the
odh-doc-examplesrepository to your workbench. -
You have opened the
s3client_examples.ipynbfile in your workbench. - You have installed Boto3 and configured an S3 client.
Procedure
In the Jupyter notebook, locate the following instructions to download files from a bucket:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Modify the code sample:
-
Replace
<bucket_name>with the name of the bucket that the file is located in… Replace<object_name>with the name of the file that you want to download. Replace
<file_name>with the name and path that you want the file to be downloaded to, as shown in the example.s3_client.download_file('aqs086-image-registry', 'series35-image36-086.csv', '\tmp\series35-image36-086.csv_old')s3_client.download_file('aqs086-image-registry', 'series35-image36-086.csv', '\tmp\series35-image36-086.csv_old')Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Replace
- Run the code cell.
Verification
- The file that you downloaded is displayed in the path that you specified on your workbench.