Skip to content

Sets up AWS infrastructure to send an automated email each day with three items from the Python Standard Library.

License

Notifications You must be signed in to change notification settings

duane9/python_emails

 
 

Repository files navigation

Daily Python Standard Library Email Automation

Overview

This project automates the daily delivery of an email with three items from the Python Standard Library. The email contains the item's name, explanation, and an example. The project uses AWS Lambda, Amazon SES, and DynamoDB to deliver the email.

Screenshot of email

Motivation

This project is a fork of the awesome Dutch Vocabulary project. I wanted to do something similar but with the Python Standard Library.

Simplified Architecture

A CloudWatch Event Rule triggers a Lambda each morning at 7:00. The Lambda retrieves all previously sent Python items from DynamoDB. It then retrieves the new item from ChatGPT, stores it in DynamoDB, and sends them to SES. SES delivers them to the end user's email.

Picture of architecture

Setup

Prerequisites

To deploy this project, ensure the following tools and configurations are in place:

  1. Tools Installed:

    • Python (Tested with Python 3.13)
    • pip (Tested with pip 19.2.3)
    • Terraform (Tested with Terraform 1.10.3)
    • AWS CLI (Tested with 2.15.58)
  2. Permissions: Your AWS CLI user must have the appropriate permissions to deploy the resources. Refer to the Terraform files and apply the principle of least privilege.

  3. Amazon SES Verified Email: You need a verified email address in Amazon SES. This email must match the one used in the project. Reference: Verifying Email Addresses in Amazon SES.

  4. Optional: You can zip the Lambda deployment package manually if you like:

    • Use the provided setup.sh script or follow the steps in the script manually.
    • Alternatively, use the pre-zipped package: deployment_package.zip.

Deployment Steps

  1. Prepare Configuration:

    • Copy terraform.tfvars.example to terraform.tfvars.
    • Fill out the required values in terraform.tfvars.
  2. Run the Terraform Workflow:

    terraform init
    terraform plan
    terraform apply

Changes from the original project

  • Made the project work with content from the Python Standard Library.
  • Did this on a Mac, so I made some changes to the setup script to work on a Mac.
  • Used Python 3.13 instead of Python 3.8.
  • Added an MIT license.

About

Sets up AWS infrastructure to send an automated email each day with three items from the Python Standard Library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 49.3%
  • Python 46.8%
  • Shell 3.9%