Skip to content

Instantly share code, notes, and snippets.

Last active October 24, 2017 03:48
What would you like to do?
import time
import requests
import smart_open
import logging
print('Loading function')
def lambda_handler(event, context):
start_time = time.time()
uri = ''
response = requests.get(uri, stream=True)
with smart_open.smart_open('s3://mylocalbucket/', 'wb') as file_gabe:
for chunk in response.iter_content(chunk_size=8096):
if chunk:
else:'File was transfer')
print("time {}".format((time.time() - start_time)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment