11/27/2020

aws s3 get all object more than 1000 python example code

simply to use paginator instance


example code

paginator = s3_client.get_paginator('list_objects_v2')
pages = paginator.paginate(Bucket='bucket', Prefix='folder1/')
for page in pages:
for obj in page['Contents']:
print(obj['Key'])

.

No comments:

Post a Comment