Skip to content

Instantly share code, notes, and snippets.

@jastang
Created March 12, 2018 20:09
Show Gist options
  • Save jastang/0cb1fb593b381e6b7005963fe7568f12 to your computer and use it in GitHub Desktop.
Save jastang/0cb1fb593b381e6b7005963fe7568f12 to your computer and use it in GitHub Desktop.
def lambda_handler(event, context):
if event is None:
print("Couldn't find the object or byte range!")
return
# The byte range is passed from the Chunking function
start_byte = event['start_byte']
end_byte = event['end_byte']
bucket = event['bucket']
key = event['key']
object = s3.get_object(Bucket=bucket, Key=key, Range='bytes={}-{}'.format(start_byte, end_byte))
# Do your basic cleaning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment