Catalog PyPI
Back to packageRELEASE DETAILS

0.1.5

PyPI

adaptive-cards-templating-py

This library largely implements the JSON-to-JSON Adaptive Cards Template language for Python. Most features are supported, except for the Adaptive expressions prebuilt functions.

Published14 May 2025
Direct dependencies1
Transitive dependenciesNot calculated

README

Version 0.1.5 documentation

Adaptive Cards Templating for Python

This library largely implements the JSON-to-JSON Adaptive Cards Template language for Python. It allows you to dynamically expand Adaptive Card templates using data and host-specific information.

Features

  • Supports most standard features of the Adaptive Cards Template language.
  • Inline data expansion with $data.
  • Conditional rendering with $when.
  • Expression evaluation using ${} syntax.
  • Custom functions like if() and json().
  • Supports $root, $host, and $index for advanced templating.

Currently unsupported

  • Adaptive expressions prebuilt functions.

Installation

To install the package, use:

pip install adaptive-cards-templating-py

Usage

Here's a quick example of how to use the library:

import json
from adaptive_cards_templating_py import Template

# Define a template
template_json = {
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "text": "${message}"
        }
    ]
}

# Create a Template instance
template = Template(template_json)

# Expand the template with data
data = {
    "$root": {
        "message": "Hello, Adaptive Cards!"
    }
}
card = template.expand(data)

# Pretty-print the card
print(json.dumps(card, indent=2))

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Write tests for your changes.
  4. Commit your changes and push the branch.
  5. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 1

Native requirements
1 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
pytest; extra == "test"runtime

Distribution files

2 collected
adaptive_cards_templating_py-0.1.5-py3-none-any.whl

bdist_wheel · 6.82 KB · Python py3

Source file
adaptive_cards_templating_py-0.1.5.tar.gz

sdist · 6.49 KB · Python source

Source file

Repository

PENDING
dionoid/adaptive-cards-templating-py

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:05 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:eef0f2f2ba9f46e82bbcc9290703425d8abb68e54359043b7e86abf3b7dfbcfb

Other collected versions

View all collected versions →