Skip to content

Instantly share code, notes, and snippets.

@QuinnyPig
Created July 22, 2022 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save QuinnyPig/29e6a0bb1734303256ac0b31962ecc94 to your computer and use it in GitHub Desktop.
Save QuinnyPig/29e6a0bb1734303256ac0b31962ecc94 to your computer and use it in GitHub Desktop.
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