Created
July 22, 2022 23:39
-
-
Save QuinnyPig/29e6a0bb1734303256ac0b31962ecc94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import requests | |
def handler(context, event): | |
url = "https://sisa.msal.gov.ar/datos/descargas/covid-19/files/datos_nomivac_covid19.zip" | |
session = requests.Session() | |
response = session.get(url, stream=True) | |
s3_bucket = "streambucket-shitposting" | |
s3_file_path = "covids.zip" | |
s3 = boto3.client("s3") | |
with response as part: | |
part.raw.decode_content = True | |
conf = boto3.s3.transfer.TransferConfig( | |
multipart_threshold=10000, max_concurrency=4 | |
) | |
s3.upload_fileobj(part.raw, s3_bucket, s3_file_path, Config=conf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment