Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

msteamsapi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

msteamsapi

Microsoft Teams AdaptiveCards API Wrapper for Python 2 and 3

  • 0.9.3
  • PyPI
  • Socket score

Maintainers
1

Stand With Ukraine Made in Ukraine Stand With Ukraine Russian Warship Go Fuck Yourself

Microsoft Teams AdaptiveCards API Wrapper for Python 2 and 3

Repository: https://github.com/ALERTua/msteamsapi
PyPi: https://pypi.org/project/msteamsapi/

Package and PyPi Upload DEV Package and TestPyPi Upload Commit Checks

Usage

  • pip install msteamsapi
  • Get a Workflow Webhook URL for your MSTeams non-private(!) channel using the standard template Post to a channel when a webhook request is received.
  • Use the Webhook URL to instantiate TeamsWebhook class.
  • Fill the TeamsWebhook with AdaptiveCard.
  • Fill the AdaptiveCard with Container.
  • Fill the Container with FactSet, TextBlock, etc.
  • send() the TeamsWebhook instance.

Example from tests/test_suite.py:

from msteamsapi import TeamsWebhook, AdaptiveCard, Container, FactSet, ContainerStyle, TextWeight, TextSize

webhook = TeamsWebhook('your_webhook_url')

card = AdaptiveCard(title='card title', title_style=ContainerStyle.DEFAULT)
card.add_background(url="https://github.com/ALERTua/msteamsapi/raw/main/tests/background.png")

container = Container(style=ContainerStyle.DEFAULT)

card.mention('EMAIL', 'NAME', add_text_block=True)
mention_tag = card.mention('EMAIL', 'mention text')

container.add_image("image url", "image alt text")
container.add_text_block(
    'multiline\n\ntext\n\nmention 1: %s' % mention_tag,
    size=TextSize.DEFAULT, weight=TextWeight.DEFAULT, color="default"
)

factset = FactSet(('fact 1', 'fact 1 value'))
factset.add_facts(('fact 2', 'fact 2 value'), ('fact 3', 'fact 3 value'))
container.add_fact_set(factset)

card.add_container(container)

for i, url in enumerate(['https://google.com/', 'https://goo.gle']):
    card.add_url_button('url %s' % i, url)

webhook.add_cards(card)
webhook.send()

Your contribution is appreciated.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc