msteamsapi-0.9.5
توضیحات
Microsoft Teams AdaptiveCards API Wrapper for Python 2 and 3
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | msteamsapi-0.9.5 |
| نام | msteamsapi |
| نسخه کتابخانه | 0.9.5 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Alexey Rubasheff |
| ایمیل نویسنده | alexey.rubasheff@gmail.com |
| آدرس صفحه اصلی | https://github.com/ALERTua/msteamsapi |
| آدرس اینترنتی | https://pypi.org/project/msteamsapi/ |
| مجوز | - |
[](https://stand-with-ukraine.pp.ua)
[](https://stand-with-ukraine.pp.ua)
[](https://stand-with-ukraine.pp.ua)
[](https://stand-with-ukraine.pp.ua)
# Microsoft Teams AdaptiveCards API Wrapper for Python 2 and 3
##### Repository: https://github.com/ALERTua/msteamsapi
##### PyPi: https://pypi.org/project/msteamsapi/
[](https://github.com/ALERTua/msteamsapi/actions/workflows/python-package.yml)
[](https://github.com/ALERTua/msteamsapi/actions/workflows/python-dev-package.yml)
[](https://github.com/ALERTua/msteamsapi/actions/workflows/commit.yml)
## 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](tests/test_suite.py):
```python
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", wrap=True
)
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](CONTRIBUTING.md) is appreciated.
نیازمندی
| مقدار | نام |
|---|---|
| ython_versio | future==1.0.0; |
| ython_versio | pathlib==1.0.1; |
| ython_versio | enum34==1.1.10; |
| ython_full_versio | importlib-resources<7.0.0,>=6.4.0; |
| ython_versio | importlib-resources==3.3.1; |
| ython_full_versio | requests<3.0.0,>=2.32.3; |
| ython_versio | requests==2.27.1; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,!=3.8.*,>=2.7 | Python |
نحوه نصب
نصب پکیج whl msteamsapi-0.9.5:
pip install msteamsapi-0.9.5.whl
نصب پکیج tar.gz msteamsapi-0.9.5:
pip install msteamsapi-0.9.5.tar.gz