get files from s3 bucket python

import boto3

s3 = boto3.client('s3', aws_access_key_id=... , aws_secret_access_key=...)
s3.download_file('BUCKET_NAME', 'OBJECT_NAME', 'FILE_NAME')

Here is what the above code is Doing:
1. Creating an S3 client
2. Calling the S3 client’s download_file method
3. Storing the file locally under the name FILE_NAME

The download_file method accepts the names of the bucket and object to download and the filename to save the file to.

You can also download a file from S3 to your local file system using the aws s3 cp command:

aws s3 cp s3://BUCKET_NAME/OBJECT_NAME LOCAL_FILE_NAME

The above command will download the S3 object to the file specified by LOCAL_FILE_NAME.

You can also download an entire S3 bucket by omitting the object name:

aws s3 cp s3://BUCKET_NAME/ . –recursive

The above command will download the entire contents of the bucket. The –recursive option will download all files in all subdirectories of the bucket.

You can also download a file from S3 to your local file system using the aws s3 cp command:

aws s3 cp s3://BUCKET_NAME/OBJECT_NAME LOCAL_FILE_NAME

The above command will download the S3 object to the file specified by LOCAL_FILE_NAME.

You can also download an entire S3 bucket by omitting the object name:

aws s3 cp s3://BUCKET_NAME/ . –recursive

The above command will download the entire contents of the bucket. The –recursive option will download all files in all subdirectories of the bucket.