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
Metadata
Release files for simple-msteams 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simple_msteams-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Release files / simple_msteams-0.0.7-py3-none-any.whl
| Download URL | simple_msteams-0.0.7-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6739d19f1fcc64f4360ded60dce2ab6974ccefb736547f09286563cac38a8b8b
|
|
BLAKE2b-256 checksum How to use checksums |
07789f25af7a344889ab82629ea9cf48059ea79f12c4a20bea2c8e99693c6b6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|