Created
September 23, 2022 12:10
-
-
Save thoughtspeed7/23fd54464d7d2ad79388211ef90ee44f to your computer and use it in GitHub Desktop.
AWS Glue - Ingest Data From External REST APIs Into Amazon S3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import boto3 | |
import json | |
def main(): | |
data = requests.get('https://dummyjson.com/products').json() | |
s3_client = boto3.client('s3') | |
s3_client.put_object(Body=json.dumps(data), Bucket='aws-glue', Key='products.json') | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment