Registry / communication / microsoft-teams-cards

microsoft-teams-cards

JSON →
library2.0.0pypypiunverified

A Python library for building Adaptive Cards and other card types used in Microsoft Teams bot messages. Part of the Microsoft Teams SDK (teams.py). Current version 2.0.0 (stable pre-release series v2.0.0a*). Active development with alpha releases publishing frequently.

pip install microsoft-teams-cards
INSTALL
IMPORT
SIG · MICROSOFT-TEAMS-CA
M
microsoft-teams-cards
communicationpythonv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AdaptiveCard
from microsoft_teams import AdaptiveCard
from microsoft.teams.cards import AdaptiveCard

Create a simple Adaptive Card and output its attachment representation.

from microsoft.teams.cards import AdaptiveCard, CardFactory card = AdaptiveCard(version='1.5') card.add_text_block('Hello, Teams!') card.add_submit_action('Submit', data={'key': 'value'}) # Get card as attachment for bot activity attachment = CardFactory.adaptive_card_attachment(card) print(attachment)
Debug
Known issues
breakingBreaking change in v2.0.0a31: `CardFactory` methods like `adaptive_card_attachment()` now require explicit card object instead of dict. Update your code to pass a card instance.
fix
Use `CardFactory.adaptive_card_attachment(AdaptiveCard(...))` instead of `CardFactory.adaptive_card_attachment({'type':'AdaptiveCard',...})`.
affects: >=2.0.0a31
deprecatedThe import path `microsoft.teams.cards` is deprecated as of v2.0.0a8. Use `microsoft_teams.cards` instead, but note that v2.0.0a8 still supports the old path with a warning.
fix
Replace `from microsoft.teams.cards import ...` with `from microsoft_teams.cards import ...`.
affects: >=2.0.0a8
gotchaPython 3.12+ only. Requires `python >=3.12, <3.15`. Installing on Python 3.11 or earlier will fail.
fix
Use Python 3.12 or 3.13. Check your Python version with `python --version`.
affects: >=2.0.0
Upgrade
Version history
2.0.0latest on PyPI · released Apr 30, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
microsoft-teams-cards — pip install microsoft-teams-cards · libregistry