wacpy
Unofficial WhatsApp Cloud API Wrapper
(WIP)
📚 About
wacpy aims to be a complete python wrapper for the WhatsApp Cloud API.
⚙ Usage
Currently, wacpy is only providing WhatsApp Cloud API objects.
The 2 main objects are:
📃 Message: (wacpy.types.message.Message)
The Message object is used to craft messages.
🔔 Notification: (wacpy.types.notification.Notification)
The Notification object is the object that gets sent to your webhook.
Images taken from Official WhatsApp Cloud API Refrence
All other sub-objects exist under this 2 types.
🖥 Examples
- A simple message:
from wacpy.types.message import Message, message # You can also import `message` from `wacpy.types`
Message(
to='{{WHATSAPP_PHONE_NUMBER}}',
text=message.Text(
body="This is a simple message!"
)
)
- An Image:
from wacpy.types import Message, message # You can also import `message` from `wacpy.types`
Message(
to='{{WHATSAPP_PHONE_NUMBER}}',
type='image',
image=message.Media(
link='https://i.imgur.com/Zf5eagv.png',
caption='Some cute cats'
)
)
- Interactive Button List
from wacpy.types import Message, message # You can also import `message` from `wacpy.types`
Message(
to='{{WHATSAPP_PHONE_NUMBER}}',
type='interactive',
interactive=message.Interactive(
type='list',
action=message.interactive.Action(
button='List',
sections=[
message.interactive.action.Section(
title='First Section',
rows=[
message.interactive.action.section.Row(
id='first_row',
title='First Row',
description='This is the first row description',
),
message.interactive.action.section.Row(
id='second_row',
title='Second Row',
description='This is the second row description',
)
]
),
message.interactive.action.Section(
title='Second Section',
rows=[
message.interactive.action.section.Row(
id='first_row',
title='First Row',
description='This is the first row description',
),
message.interactive.action.section.Row(
id='second_row',
title='Second Row',
description='This is the second row description',
)
]
)
]
),
body=message.interactive.Body('This is the body text')
)
)
Click here to see more examples (Soon!)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wacpy-0.3.0.tar.gz
(35.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
wacpy-0.3.0-py3-none-any.whl
(66.1 kB
view details)
File details
Details for the file wacpy-0.3.0.tar.gz.
File metadata
- Download URL: wacpy-0.3.0.tar.gz
- Upload date:
- Size: 35.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/4.0.1 CPython/3.9.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
009d40e64b50d6fb5b3780453e25bba4e6b09030377cbff5d6e3fc115ed76ac2
|
|
| MD5 |
b8129ac7dcfb9f39a8c62065db1a6266
|
|
| BLAKE2b-256 |
82c90f71ca101c9e60f233a7b81cb61b524e2ba1cc79f20ade0206ac0408dcdd
|
File details
Details for the file wacpy-0.3.0-py3-none-any.whl.
File metadata
- Download URL: wacpy-0.3.0-py3-none-any.whl
- Upload date:
- Size: 66.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/4.0.1 CPython/3.9.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
060156d913fcde796bd2acc9d2d8870e5e82ff7b44e1fbca621a7d3d4a9fc8c9
|
|
| MD5 |
adf8a0145bef3ca7f60512d222a27f56
|
|
| BLAKE2b-256 |
ec6f22fb114c29a1d87150b9eccdf08cddca026a283acb18af2e10de0cb2ea29
|