Python Forum

Full Version: AWS Boto3 - objects function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi ,

I am using this code to display each key or file of AWS S3 bucket.

It is doing the job that I want. However, When I look at AWS Boto3 package documentation, I could not locate "objects" function in Boto3 package. Is the objects function part of Boto3 or any other package or module ?

import boto3

#Then use the session to get the resource
s3 = session.resource('s3')

my_bucket = s3.Bucket('stackvidhya')

for my_bucket_object in my_bucket.objects.all():
    print(my_bucket_object.key)