Official Python wrapper for the WhatsApp Cloud API by Tarmica Chiwara
Project description
Pygwan
Unofficial Python wrapper for the WhatsApp Cloud API by Tarmica Chiwara.
Installation
To install the WhatsApp Python wrapper, use the following command:
pip install pygwan
Usage
Import the WhatsApp
class from the package and initialize an instance with your WhatsApp token and phone number ID:
from pygwan import WhatsApp
whatsapp = WhatsApp(token="your_token", phone_number_id="your_phone_number_id")
Sending a Message
You can send a text message to a WhatsApp user using the send_message
method:
whatsapp.send_message("Hello, this is a test message.", "recipient_phone_number")
Replying to a Message
Reply to a message using the reply_to_message
method:
whatsapp.reply_to_message("message_id", "recipient_phone_number", "Reply message.")
Sending a Template
Send a template message using the send_template
method:
components = [
# List of template components
# Example: {"type": "text", "text": "Hello, this is a template message."}
]
whatsapp.send_template("template_name", "recipient_phone_number", components)
Sending a Location
Send a location message using the send_location
method:
whatsapp.send_location("-23.564", "-46.654", "Location Name", "Location Address", "recipient_phone_number")
Sending an Image
Send an image message using the send_image
method:
image_link = "https://example.com/image.jpg"
whatsapp.send_image(image_link, "recipient_phone_number")
For more detailed usage and information, please refer to the official documentation in the code lol
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pygwan-0.2.3.tar.gz
.
File metadata
- Download URL: pygwan-0.2.3.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38b5bc3157d1b83a1274e842d09d6808539694b23e4924bc9361e4ff3463216c |
|
MD5 | c9905eaf472950a8582ee035bf74f6b9 |
|
BLAKE2b-256 | 355e93eccbc8855919e4a8a55e72a246cf1eba4f69abaccffd0341f2d4370239 |
File details
Details for the file pygwan-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: pygwan-0.2.3-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a2abf324fa616c6e416848b29221d9a9b4c38d030af725ef5b55218672fe086 |
|
MD5 | 49ce6dcc96dea443b8fa1751c993512a |
|
BLAKE2b-256 | 030ecd7f19952ed0ac093d43a95156a3b126b0ceb615e50c6bf82290bf1384eb |