Automation of WhatsApp message sending with PyWhatKit
WhatsApp-Sender is a desktop application designed to automate the sending of WhatsApp messages using Python. It leverages the PyWhatKit library for message automation and the Flet library for its graphical user interface. This tool allows users to send messages automatically from an XLSX database, utilizing PyWhatKit's web navigation capabilities.
- Python 3.6 or higher
- PyWhatKit
- Flet
- Clone the WhatsApp-Sender repository to your local machine.
- Install the necessary dependencies by running
pip install -r requirements.txt
- Run the application with
`python app.py
Before using WhatsApp-Sender, it's crucial to log in to WhatsApp Web. This step is essential for the application to function correctly.
- Load the XLSX database: Use the graphical user interface to load your XLSX database.
- Select the templates: Choose the template for the message and modify its variables if necessary. The variables are enclosed in curly braces (e.g.,
{nombre}
,{empresa}
,{direccion}
) and will be replaced by each row's data from the XLSX database. - Send the messages: The application will automatically send the messages to the recipients in the database.
- Preview: The application provides a preview feature that renders the first record of the database with the selected template.
- Instant message sending: Messages are sent instantly without scheduling.
- Template management: Allows saving, updating, and deleting templates.
- Variable substitution: Variables in templates are replaced with data from the XLSX database.
- Preview functionality: Renders the first record of the database with the selected template for preview.
Include screenshots of the application here to provide a visual guide on how to use it.
To package the application for distribution, follow these steps:
- Open a command prompt or terminal window.
- Navigate to the root directory of your project.
- Run the following command:
flet pack src\app.py --icon src\assets\logo.png --add-data "sample.xlsx;."
This command will create a distributable package of your application, including the sample.xlsx
file in the root directory of the package.
If the --add-data
option does not work as expected and the sample.xlsx
file is not included in the dist
folder, you can manually copy the file to the dist
folder. Here's how to do it on Windows:
- Open File Explorer.
- Navigate to the
src
directory within your project. - Find the
sample.xlsx
file. - Copy the file.
- Navigate to the
dist
directory within your project. - Paste the
sample.xlsx
file into thedist
directory.
By following these steps, you ensure that the sample.xlsx
file is included in the distributable package of your application.
flet pack main.py --icon src\assets\logo.png --add-data "src\sample.xlsx;."
Contributions are welcome. Please follow the contribution guidelines.
WhatsApp-Sender is licensed under the MIT License. See the LICENSE
file for more details.