I want to get names of all images from "[BUCKET_NAME]/imagefolder/" in AWS SDK for Python using boto3

Question:

I want to get the list of all the images present in a specific directory on s3 using boto3 but I am unable to do so. In my case the images are located in "[BUCKET_NAME]/images/xyz.png" and I would like to get the list of all the images in that folder.

Answers:

This logic is shown in the AWS CODE EXAMPLE repo under Python. I recommend that you look and understand the code in this example, that shows various Amazon S3 operation – including how to list objects in a bucket using the AWS SDK for Python.

https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/python/example_code/s3/s3_basics/scenario_getting_started.py

Here is a new Code Catelog that breaks down each example into SDK or Service. This is a new doc…

https://docs.aws.amazon.com/code-library/latest/ug/what-is-code-library.html

Answered By: smac2020