A Python package to send WhatsApp messages through Trenalyze
Project description
trenalyze(PYTHON) V0.0.2
Library Prerequisites
- Python >=3.6
- WhatsApp account.
- Active Token - Get a Token here.
Installation
Using PIP:
$ pip install trenalyze__python
In PYTHON:
Note: You'll need to Import the Trenalyze Python Library after installation
# Load the full build.
from trenalyze__python import Trenalyze
API
1. Creating an instance of the Trenalyze class.
# Creating an instance of the Trenalyze class.
trenalyze = Trenalyze()
| Param | Type | Description |
|---|---|---|
| token | string |
Use your Trenalyze Token from your Dashboard. |
# Setting the API key for the Trenalyze API.
trenalyze.setToken(token)
Note: Phone number should be in the following format 12345678912, without + or any other symbols
2. Initialize needed variables
| Param | Type | Description |
|---|---|---|
| sender | string |
Enter the WhatApp Number that has already been scanned on the Trenalyze Dashboard. |
| receiver | string |
Phone number should be in the international format 2348157002782, without + or any other symbols. |
| msgtext | string |
Enter the desired text message to send. |
| mediaurl | string |
(OPTIONAL). BUT MUST BE DECLARED This should be a valid media/file link. Learn More |
| buttons | array |
(OPTIONAL). BUT MUST BE DECLARED You can attach quick replies buttons to your message. Learn More |
| debug | boolean |
(OPTIONAL). Default is false. But you can set it to be true and the debug message is passed onto the console. |
# Set the Required Parameters for sending a message
sender = 'YOUR_WHATSAPP_NUMBER'
receiver = 'RECIPIENT_NUMBER'
msgtext = 'Hello World'
mediaurl = 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
buttons = [
['index' => 1, 'urlButton' => ['displayText' => 'Visit my website!', 'url' => 'https://trenalyze.com']],
['index' => 2, 'callButton' => ['displayText' => 'Call me!', 'phoneNumber' => '+1 (234) 5678-9012']],
['index' => 3, 'quickReplyButton' => ['displayText' => 'This is a reply, just like normal buttons!', 'id' => 'id-like-buttons-message']]
]
NOTE: When not using mediaurl and buttons set to NULL
mediaurl = ''
buttons = ''
3. Send The Required Variables
trenalyze.setSender(sender)
trenalyze.setReceiver(receiver)
trenalyze.setMsgtext(msgtext)
NOTE: You can set Debug to True or False. It's False By default
trenalyze.setDebug(True)
4. Initialize SendMessage
# Initialize the send WhatsApp message functions
res = trenalyze.sendMessage()
print(res)
5. Sample Response
{
'status': True,
'response': {
'message': 'Messages sent successfully'
}
}
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
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
File details
Details for the file trenalyze__python-0.0.2.tar.gz.
File metadata
- Download URL: trenalyze__python-0.0.2.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f76bff958b8bbb99738e42ac6ea85218f0b56347b139efbaf597a3cd27cb0274
|
|
| MD5 |
d4209dbc1699ee1f744b9491d22614d2
|
|
| BLAKE2b-256 |
cdc3612128c6be86f2e0edd1be6ae8af390b3eaa47351f914d9acd9525272669
|
File details
Details for the file trenalyze__python-0.0.2-py3-none-any.whl.
File metadata
- Download URL: trenalyze__python-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags:
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f51d8f81ef2e10a897a3e8fbde09158f9a5dab77632f949f185b8b4bb7a0c82
|
|
| MD5 |
1f946535a8141658572dd906798777dc
|
|
| BLAKE2b-256 |
2be61a6ba234a50a09db22096702bc53b022267ff648d94c4d077c8bc771f7cf
|