Python Forum
AWS Boto3 - objects function - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: AWS Boto3 - objects function (/thread-42157.html)



AWS Boto3 - objects function - PythonDialer - May-19-2024

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)