Skip to main content

A Python package to send WhatsApp messages through Trenalyze

Project description

trenalyze(PYTHON) V0.0.1

Author | Docs

Library Prerequisites

  1. Python >=3.6
  2. WhatsApp account.
  3. 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


Download files

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

Source Distribution

trenalyze__python-0.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file trenalyze__python-0.0.1.tar.gz.

File metadata

  • Download URL: trenalyze__python-0.0.1.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

Hashes for trenalyze__python-0.0.1.tar.gz
Algorithm Hash digest
SHA256 21c84c3a7a5b200c4fb390b84835b1f86b846fcc75304c28a0955038d38ec1d3
MD5 549165ed320778294a3062dd0ee28ff3
BLAKE2b-256 e1f18d2827bf2abf81b457f4b8b4c2c6d3515bd20cb2beee30904aa621e61123

See more details on using hashes here.

File details

Details for the file trenalyze__python-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for trenalyze__python-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b67f05ee8ed74ddbb5d2bb615d8cf991003a484ec1c36c459c6f91e3d08e4d3
MD5 40224f0004337d8da0cebe268aac1576
BLAKE2b-256 ce02e6b7d2ffe38d124ab4f6b1ba226d87020893655a6d2b51c7226741147228

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