Created
February 20, 2018 15:43
-
-
Save PetrGlad/d257ac451f0633c4a70fb2a004acc99a to your computer and use it in GitHub Desktop.
aws-examples
This file contains hidden or 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 | |
import gzip | |
s3 = boto3.client('s3') | |
# get gz file content | |
content = gzip.decompress( | |
s3.get_object(Bucket='a-bucket-id', | |
Key='a-key')['Body'].read()) | |
# list files/objects | |
all_files = [x['Key'] for x in s3.list_objects_v2(Bucket='a-bucket-id', Prefix='a-key')['Contents']] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment