Skip to main content

WhatsApp Cloud API is complicated, Twilio is expensive, PyGwan is the opposite of both. Free & Intuitive! ~ 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


Download files

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

Source Distribution

pygwan-0.1.4.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

pygwan-0.1.4-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file pygwan-0.1.4.tar.gz.

File metadata

  • Download URL: pygwan-0.1.4.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.6

File hashes

Hashes for pygwan-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a4a4786329521e95cfdc3c1e95a6daf6b2d88200b01b20aa6a145e049dbc80b1
MD5 43786deb8e24bd408e3b0d78be494aab
BLAKE2b-256 934308f675fe6ce01d86032532423c093c6b528bd25c0245f753c0e8a1b1ad9e

See more details on using hashes here.

File details

Details for the file pygwan-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pygwan-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.6

File hashes

Hashes for pygwan-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5fdb91687cc3e7c48c0cff263bc3cc7163b41a9f8a97177b1f33695205b38673
MD5 b38c80405c32150f1cff6d5491ec2533
BLAKE2b-256 fffe2b0fa601a0262f90982f1a9b7055da4f1d089c2594473ad5f4274796400c

See more details on using hashes here.

Supported by

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