Skip to content

Instantly share code, notes, and snippets.

@enricofer
Last active January 10, 2023 22:07
Show Gist options
  • Save enricofer/21d8975d5ee0487920609f99f0a5ffa7 to your computer and use it in GitHub Desktop.
Save enricofer/21d8975d5ee0487920609f99f0a5ffa7 to your computer and use it in GitHub Desktop.
List s3 public bucket objects without AWS credentials
# pip install boto3
import boto3
import botocore
s3client = boto3.client('s3', region_name='eu-central-1') #specify aws region
#exclude credential signing, otherwise, without providind AWS credential you will get a "NoCredentialsError"
s3client.meta.events.register('choose-signer.s3.*', botocore.handlers.disable_signing)
objects = s3client.list_objects(Bucket='vito.landcover.global')
for item in objects["Contents"]:
print (item["key"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment