I can capture and read all objects in my AWS S3 bucket through
s3 = boto3.resource('s3')
bucket = s3.Bucket('my-bucket')
all_objs = bucket.objects.all()
for obj in all_objs:
pass
and then
obj.key
will give me a way in a bucket.
Is there a way to pre-filter only those files that belong to a specific start path (the directory in the bucket) so that I can avoid traversing all objects and filtering later?
source
share