PyTeams-Msg
This module allows to build and send custom messages to Microsoft Teams Webhooks.
Message Types
For the time being only the message type container has been implemented.
AdaptiveCards
Adaptive cards are platform-agnostic snippets of UI, authored in JSON.
Card Elements
The following are the currently implemented card elements that can be added to the AdaptiveCard sections.
- TextBlock: Displays texts, allowing control over font sizes, weight and color
- Image: Displays an image. Acceptable formats are PNG, JPEG, and GIF. The URL field allows data URI since v1.2+
For further information on all the available snipets and it's format check: https://adaptivecards.io/explorer/
Sample Usage
from pyteams_msg.teamsmessage import TeamsMessage
from pyteams_msg.adaptivecard import AdaptiveCard
from pyteams_msg.sections import TextBlock, Image
my_msg = TeamsMessage(webhook=os.environ["TEAMS_WEBHOOK"])
card = AdaptiveCard()
title_section = TextBlock(
"Some cool clickbait",
size=TextBlock.SIZE_EXTRA_LARGE
color=TextBlock.COLOR_ACCENT
)
body_section = TextBlock("Beer Ipsum... yada yada")
image_from_url = Image("https://cdn.pixabay.com/photo/2016/11/21/15/48/dog-1846066_960_720.jpg")
image_from_file = Image()
image_from_file.add_image("path/to/some/file")
card.add_section(title_section)
card.add_section(body_section)
card.add_section(image_from_url)
card.add_section(image_from_file)
my_msg.add_card(card)
my_msg.send()
Metadata
Release files for pyteams-msg 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyteams_msg-0.0.2.tar.gz | 16.3 kB | Without provenance | Details for pyteams_msg-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyteams_msg-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for pyteams_msg-0.0.2-py3-none-any.whl |
Total release size: 34.2 kB
Release files / pyteams_msg-0.0.2.tar.gz
| Download URL | pyteams_msg-0.0.2.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc5bcbcd5cb23f0beb3b5204891a93396596e56b0f6874c0b6ce8db69111014a
|
|
BLAKE2b-256 checksum How to use checksums |
cdf3f399163c713612856f9953dac732e692faa86cb1fef46688eac5551c655a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Release files / pyteams_msg-0.0.2-py3-none-any.whl
| Download URL | pyteams_msg-0.0.2-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
01a6b2cf6e3c7b0a0c9289dd0e866058cbe056387d8f9f586b092880f1425b9a
|
|
BLAKE2b-256 checksum How to use checksums |
bc656fc0d44fe39218b41ea8e20dc01b820d41312f92efdf5712cf832384c8c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Security for pyteams-msg 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.