Skip to main content

Unofficial 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")

Documentation

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.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

pygwan-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pygwan-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6f9ff621baa1b0b3f67b8ca1af5a8d773da215db8e16d55fb37ab0b4bc1c10b6
MD5 38137ba43995475b6dd9a619e4d987be
BLAKE2b-256 6ca6b5860778050b716b2a548abf89711f8990fe20ff88a3ca21cde5d81a18c5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pygwan-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b6e4a508b264e9ae46d4ca4c46ae20f9ab9374c12c313844893f2376c28abc4
MD5 de55e31e32b03096f1373ece2f25c385
BLAKE2b-256 088decf58e679bc5b87281f2c731ecb3f36e2428af9eecd467c6064501e8d315

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