Created
June 29, 2015 21:46
-
-
Save amatthies/c7a31688d06fdb131712 to your computer and use it in GitHub Desktop.
List the top folders of a s3 bucket using boto3. https://github.com/boto/boto3/issues/134
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
client = boto3.client('s3') | |
paginator = client.get_paginator('list_objects') | |
for result in paginator.paginate(Bucket='edsu-test-bucket', Delimiter='/'): | |
for prefix in result.get('CommonPrefixes'): | |
print(prefix.get('Prefix')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment