Reputation: 1
is there a way to use boto3 to print the filenames within an s3 bucket object?
the bucket looks like this
Is there a way to use boto3 to print the names of files?
Upvotes: 0
Views: 96
Reputation: 36444
Of course, like so
client = boto3.client('s3')
objects = client.list_objects(Bucket='yourbucketnamegoeshere')
for obj in objects['Contents']:
print(obj['Key'])
Done
Upvotes: 1