Skip to main content

Yet Another Expansion Syntax (pronounced 'Yasssss Kweeeeen')

Project description

Yet Another Expansion Syntax (pronounced ‘Yasssss Kweeeeen’) for expanding complex data (YAML / JSON) with Jinja2 templating:

import yaes

values = {
    "a": 1,
    "cs": [2, 3],
    "ds": "nuts"
}

block = {
    "transpose": {
        "b": "a"
    },
    "iterate": {
        "c": "cs",
        "d": "ds"
    },
    "condition": "{{ c != 3 and d != 't' }}",
    "values": {"L": 7}
}

list(yaes.each(block, values))
# [
#     (block, {"a": 1, "cs": [2, 3], "ds": "nuts", "b": 1, "c": 2, "d": "n", "L": 7}),
#     (block, {"a": 1, "cs": [2, 3], "ds": "nuts", "b": 1, "c": 2, "d": "u", "L": 7}),
#     (block, {"a": 1, "cs": [2, 3], "ds": "nuts", "b": 1, "c": 2, "d": "s", "L": 7})
# ]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yaes-0.1.3.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

yaes-0.1.3-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page