Skip to main content

since i lost the original package, i am trying to create a new one.

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

This version

0.1

Download files

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

Source Distribution

pygwan2-0.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

pygwan2-0.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file pygwan2-0.1.tar.gz.

File metadata

  • Download URL: pygwan2-0.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.0

File hashes

Hashes for pygwan2-0.1.tar.gz
Algorithm Hash digest
SHA256 07ab055f9a38129e3afba8faac28db427a4f54a8f0b8eda39568e8d94cff28ef
MD5 c4243098359605370659c8c2699f8c30
BLAKE2b-256 dd1e3aeb5d48cadf2354eb23322da573571134b75f7f05e5f56233291dd58d12

See more details on using hashes here.

File details

Details for the file pygwan2-0.1-py3-none-any.whl.

File metadata

  • Download URL: pygwan2-0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.0

File hashes

Hashes for pygwan2-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d9f1120cf56a30ab3a469bc8dbfa97dd292df513f34c6dffcf7305ee1768ec3c
MD5 029c69295c815f0c1637441f44e5803e
BLAKE2b-256 c215a1276220c4bbb62d14cac8671e811b0d87191c883b43667b659b0fe9913d

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