Nerd For Tech
Published in

Nerd For Tech

Automating WhatsApp, Email and launching an AWS instance using Python

Objective :

To create a program that performs the given below tasks upon recognizing a particular face —

  • When it recognizes your face then :
    -> It sends an email to your mail id.
    -> And also a WhatsApp message to your friend or anyone else.
  • When it recognizes another face, it can be your friend or family members face, it should do the following :
    ->Creates EC2 instance in the AWS.
    -> Creates 5 GB EBS volume and attach it to the instance.

Let’s get to the task !

Part one : Building and Training a Face recognition model

For this we will be using the Haar Cascade Frontal Face Detector to train our model.

Collecting Dataset
Training the model

Done , now we can use this model to perform our tasks.

Part two : Automating WhatsApp , E-mail and AWS EC2 instance launching

  • AWS CLI setup

For this refer the following -

->https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html

->https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html

  • Python library called PyWhatKit should also be installed as given below functions will be used -

Function 1: send_mail(email_sender: str, password: str, subject: str, message: str, email_receiver: str)

Function 2: sendwhatmsg(phone_no: str, message: str, time_hour: int, time_min: int, wait_time: int = 20, print_wait_time: bool = True, browser: str = None)

Hence, in this way on the face being recognized the program emails and sends the WhatsApp message to the specified email and number respectively and in case it fails to recognize the face, it launches an EC2 instance in AWS along with creating a 5 GB EBS volume and attaches it to the instance.

GitHub Repository link for reference : https://github.com/AmimaShifa/Automating-Email-WhatsApp-and-launching-AWS-instance-using-Python/tree/main/task%206

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Amima Shifa

Self - motivated Programmer | A.I. Enthusiast | Freelance Software Developer | Undergrad CSE Student