Skip to main content

Automatically send Whatsapp messages and files

Project description

What is Pyzapkit?

Do you waste countless hours sending messages though Whatsapp? Do you need to send the same file over and over again to different contacts? Say no more. Pyzapkit lets you automate all of your Whatsapp messages!

Using selenium and pyautogui, Pyzapkit lets you send text messages or files, instantly or at a certain time of the day

How to use it

First, install pyzapkit:

pip install pyzapkit

Import the Pyzap class:

from pyzapkit.main import Pyzap

Now, you need to check which Google Chrome profile has your whatsapp web account, to do this, go to:

On linux

/home/your_user/.config/google-chrome

On windows

C:\Users\your_user\AppData\Local\Google\Chrome\User Data

Inside those folders will be your chrome profiles. Usually, they will be named as 'Profile 1', 'Profile 2', 'Profile 3' and so on, but they can also be named as 'Default' or your chrome user name. Choose the one that has your whatsapp web account login.


Instantiate Pyzap with your Chrome profile as an argument:

whatsapp = Pyzap('Profile 2')

From there, you can:

Send text messages

whatsapp.send_message('123456789', 'a message')

To send text messages at a given time

whatsapp.send_message('123456789', 'a message', False, '14', '15')
  • Use 24-hour format
  • You can use an int or a str as the phone number
  • It is not needed to start the phone number with the plus (+) sign

A Chrome browser will be opened and the message will be sent.


Send images or videos

whatsapp.send_file('123456789', 'path/to/your/file.png')
  • You can send both images (jpg, jpeg or png) or videos (mp4).

You can also send a file at a certain time.

whatsapp.send_file('123456789', 'path/to/your/file.png', instantly=False, hour='14', min='15')

You can also specify how long the browser will wait for the file to upload

whatsapp.send_file('123456789', 'path/to/your/file.png', '5', False, '14', '15')

When using this method, a browser will be opened, then a dialog box will be opened, when this happens, don't move your mouse nor use your keyboard, because they will be used to automate the file sending process.


Send document files

whatsapp.send_doc('123456789', 'path/to/your/doc.pdf')

As always, you can schedule it

whatsapp.send_doc('123456789', 'path/to/your/doc.pdf', instantly=False, hour='14', min='15')

Just like with files, you can choose a upload waiting time

whatsapp.send_doc('123456789', 'path/to/your/doc.pdf', '5', False, '14', '15')

Requirements

  • Google Chrome version 115
  • On linux, use xorg display server
  • before running the script, download the following pyautogui dependencies:
sudo apt install scrot
sudo apt install python3-tk 
sudo apt install python3-dev 

Recommendations

  • When using send_file or send_doc methods, make sure that your directories or files do not have any accent, like ã, ê, ñ etc.
  • Before using this script, open your browser with your whatsapp web account logged in and let it load your messages. Whatsapp web almost always backup your messages and this time loading the messages can break the script.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyzapkit-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyzapkit-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pyzapkit-0.1.0.tar.gz.

File metadata

  • Download URL: pyzapkit-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pyzapkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 606a9d6c0d06160152d8aa368b15aa914773bdb30c6e377121bc0b6e1684b698
MD5 1fe2157ae58d1bbd7b325b8081a16bed
BLAKE2b-256 3acb7e871844cce8c58f02603009fb8fb7d45b849c02f74bda89333ebc5625de

See more details on using hashes here.

File details

Details for the file pyzapkit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyzapkit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pyzapkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87090ae121bb709f1fc2f107c6b020538b8df1c74ff76a566f6724e10b70f267
MD5 fb5084b65d8a9ff340f6c661940625a4
BLAKE2b-256 c8cd6f5bf655c25e9536b3d38e66a97f7ec07873070f9e9eb7c476eeb224587c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page