Today we'll be talking about this awesome Python package that lets you Automate WhatsApp.
pip3 install pywhatkit
Apart from being a WhatsApp API kinda package it also has a lot of other features, it is also a very light weight package and ideal for production usage.
More details can be found in it's wiki page.
Some important functions we'll be seeing in this review blog are:
- Send automated messages in WhatsApp.
- Send automated images in WhatsApp.
- Play a video on YouTube using PyWhatkit.
- Convert text to handwritten texts.
import pywhatkit as pw pw.sendwhatmsg("+XXxxxxxxxxxx","Your message here",'hour','min')
The first argument("+XXxxxxxxxxxx") is the phone number of the recipient, the second parameter("Your message here") is the message parameter where you enter the content of the text.
The 3rd parameter('hour') is the hour at which the message is to be sent, and the 4th('min') one is the minute of the hour at which it should be sent.
Note that the hour should be in the 24 hour format.
import pywhatkit as pw pw.sendwhats_image(phone_no="enter phone number with country code", img_path="C:/Users/user/desktop/image.jpg", caption="Example image sent!")
The first parameter is the phone number of the recipient(phone_no="phone number with country code").
The second parameter is the path of the image that is to be sent(img_path="C:/Users/user/desktop/image.jpg").
The third parameter is the caption text for the image that is to be sent (caption="Example image sent!").
import pywhatkit as pw pw.playonyt("Your topic or video here")
The top most video related to that topic will play on YouTube.
import pywhatkit as pw pw.text_to_handwriting("Your text here!")
The only parameter here is the text parameter, the given input is then converted into handwritten text.
This it for this tutorial!
Hope this tutorial helped you gain some insight on WhatsApp automation using Python! Stay tuned for more awesome tutorials and packages.