import boto3
# The AWS profile that has access to the S3 bucket
AWS_PROFILE = "your_profile"
# Information about the location of the dataset in the S3 bucket
S3_BUCKET = "bucket_name"
S3_KEY = "path/to/dataset.csv"
OUTPUT_FILE = "dataset.csv"
session = boto3.session.Session(
profile_name=AWS_PROFILE
)
s3 = session.client("s3")
s3.download_file(
Bucket=S3_BUCKET,
Key=S3_KEY,
Filename=OUTPUT_FILE
)