gh2s3_2.py 321 B

1234567
  1. def upload_hour_data_to_s3(_datetime, url):
  2. print("Requesting", url)
  3. response = requests.get(url)
  4. if response.status_code != 200:
  5. print(response)
  6. json_string = GzipFile(fileobj=BytesIO(response.content)).read()
  7. S3_BUCKET.put_object(Key=json_file_name_for_datetime(_datetime), Body=json_string)