Skip to content

Instantly share code, notes, and snippets.

@takakabe
Created January 15, 2018 13:28
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 takakabe/62d9fa615607172bb59ebfad79cdbe18 to your computer and use it in GitHub Desktop.
Save takakabe/62d9fa615607172bb59ebfad79cdbe18 to your computer and use it in GitHub Desktop.
python
# coding: utf-8
def lambda_handler(event, context):
import boto3
s3 = boto3.client('s3')
bucket_name = 'kabegiwa_bucket'
file_name = 'syukujitsu.csv'
response = s3.get_object(Bucket=bucket_name, Key=file_name)
body = response['Body'].read()
bodystr = body.decode('utf-8')
lines = bodystr.split('\r\n')
print(lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment