boto3でS3からファイルをダウンロード
#S3 #boto3
code:python
import boto3
s3 = boto3.resource('s3') #S3オブジェクトを取得
bucket = s3.Bucket('バケット名')
bucket.download_file('S3のバケット以下のpath', '保存先のpath')
code:python
import boto3
from urllib.parse import urlparse
s3 = boto3.resource('s3')
parsed_s3_uri = urlparse("s3://test-dlsite-shuffle-recommender/tmp/test.txt")
bucket = s3.Bucket(parsed_s3_uri.netloc)
bucket.download_file(parsed_s3_uri.path1:, "tmp.txt") #s3パスの先頭のスラッシュ不要
S3URIが与えられている場合は、パースして分解する