Issue
I have a relatively simple task:
- Scrape some data off the web daily and save the results as a csv file.
- Create some charts from the csv file and save them as a pdf.
- Send the pdf to my email.
The scripts would be in Pyhton and are relatively simple, I do not need to pull a lot of data either. My question would be what is the (1) easiest (2) cheapest way to do this? Are there any resources you would recommend to building this type of automated infrastructure in the cloud for beginners?
I understand I will have to use some sort of cloud provider (AWS?) and would like some guidance on this based on other people's experiences.
Thanks in advance!
Solution
This can all be done using the AWS SDK that let you programmatically interact with AWS Services. As you want to work in Python, you can use AWS SDK for Python for this use case.
Here are high level steps:
- After you create your PDF doc, use Python S3 SDK to place it within a S3 bucket. If desired, you can also place CSV in an S3 bucket too.
- You can presign the PDF doc so users can access it.
- Get the URL of the presigned PDF doc and then use AWS SES to send an email with the presigned URL.
If you do not know how to use Python SDK, look at the examples in the AWS Code Lib.
Code examples for SDK for Python (Boto3)
Answered By - smac2020
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.