Registry / serialization / adaptive-cards-py

adaptive-cards-py

JSON →
library0.4.2pypypiunverified

Python library for building Adaptive Cards using Pydantic models. Version 0.4.2, requires Python >=3.10. Uses Pydantic v2 for validation. Active development.

pip install adaptive-cards-py
INSTALL
IMPORT
SIG · ADAPTIVE-CARDS-PY
A
adaptive-cards-py
serializationpythonv0.4.2
Install
6.3s avg
Import
Disk
98MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 7.6s
py 3.11
✓ —
✓ 6.3s
py 3.12
✓ —
✓ 5.6s
py 3.13
✓ —
✓ 5.9s
py 3.9
✕ build_error
✕ build_error
98MB installed
● package 98MB
Code
Verified usage

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

AdaptiveCard
from adaptive_cards import AdaptiveCard
from adaptive_cards.models import AdaptiveCard

Creates a simple Adaptive Card with a text block and prints JSON.

from adaptive_cards import AdaptiveCard from adaptive_cards.elements import TextBlock card = AdaptiveCard() card.add_item(TextBlock(text='Hello, World!')) print(card.to_json())
Debug
Known issues
breakingv0.3.0 replaced dataclasses with Pydantic. If you used dataclass serialization, your code will break.
fix
Update to use Pydantic models and .to_json() method.
affects: <0.3.0
breakingv0.4.0 restructured modules: elements are now in submodules like adaptive_cards.elements.
fix
Use from adaptive_cards.elements import TextBlock instead of from adaptive_cards import TextBlock.
affects: <0.4.0
gotchaIf you miss the 'type' field in payload when submitting to Teams, the card may not render. This was fixed in v0.2.1.
fix
Upgrade to v0.2.1 or later.
affects: >=0.2.0, <0.2.1
Upgrade
Version history
0.4.2latest on PyPI · released Dec 16, 2025
Audit
Dependencies
pydanticrequiredUsed for data validation and serialization since v0.3.0
Agent activity
60 hits · last 30 days
node
49
OpenAI (training)
2
Resources
adaptive-cards-py — pip install adaptive-cards-py · libregistry