Simple way to handle teams workflow with python
Project description
Simple way to handle teams workflow message with python. It supports sending message cards to the Teams channel
Installation
install the latest stable version using pip
$ pip install simple-msteams
Usage
from simple_msteams.client import Client
url = < WORKFLOW URL >
timeout = < TIMEOUT > # default 15 seconds
c = Client(url) # if you set a timeout, use to c = Client(url, timeout)
Functions
safe_send
This function performs the function of sending messages to the teams.
# string or dict
# string: "this is sample message"
# dictionary: '{"type": "TextBlock", "text": "this is sample message", "weight": "bolder", "size": "medium"}'
msg = < MESSAGE >
c.safe_send(msg)
Use console scripts
# timeout not required. default 15
simple_msteams --url < WORLFLOW URL > --msg < MESSAGE > --timeout < TIMEOUT >
Example
# timeout not required. default 15
simple_msteams --url 'http://test.workflow.url' --msg 'this is sample message' --timeout 30
# if use dictionary
simple_msteams --url 'http://test.workflow.url' --msg '{\"type\": \"TextBlock\", \"text\": \"this is sample message\", \"weight\": \"bolder\", \"size\": \"medium\"}' --timeout 30
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for simple_msteams-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 845f96910600af90f49baad259f9e7aa4d0f83fff7e61358cc623960e62781e7 |
|
MD5 | 45761ca859a121c95b1ff523dca5ffb7 |
|
BLAKE2b-256 | 05774b2f0ce9d2521637f5af4388090230572e80e3a039c810d3ad2d7ad7887d |