Skip to content

Instantly share code, notes, and snippets.

@jaklinger
Created November 7, 2018 13:04
Show Gist options
  • Save jaklinger/2ed256016ee7af8569a89d457dc11cbf to your computer and use it in GitHub Desktop.
Save jaklinger/2ed256016ee7af8569a89d457dc11cbf to your computer and use it in GitHub Desktop.
Write json to s3
import boto3
import json
from io import StringIO
s3 = boto3.resource("s3")
data = [{"a":1, "c":3},{"b":2}]
s3_obj = s3.Object(<BUCKET NAME>, <FILE MAME>)
s3_obj.put(Body=json.dumps(data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment