import concurrent.futures
import boto3
import json
files = ["path-to-file.json", "path-to-file2.json"]
def download_from_s3(file_path):
# setup a new session
sess = boto3.session.Session()
client = sess.client("s3")
# download a file
obj = client.get_object(Bucket="<your-bucket>", Key=file_path)
resp = json.loads(obj["Body"].read())
return resp
with concurrent.futures.ThreadPoolExecutor() as executor:
executor.map(download_from_s3, files)
출처
https://stackoverflow.com/questions/52820971/is-boto3-client-thread-safe