yte


Nameyte JSON
Version 1.5.4 PyPI version JSON
download
home_pagehttps://github.com/yte-template-engine/yte
SummaryA YAML template engine with Python expressions
upload_time2023-12-11 09:15:00
maintainer
docs_urlNone
authorJohannes Köster
requires_python>=3.7
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # YTE - A YAML template engine with Python expressions

[![Docs](https://img.shields.io/badge/user-documentation-green)](https://yte-template-engine.github.io)
[![test coverage: 100%](https://img.shields.io/badge/test%20coverage-100%25-green)](https://github.com/yte-template-engine/yte/blob/main/pyproject.toml#L30)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/yte-template-engine/yte/testing.yml?branch=main)
![PyPI](https://img.shields.io/pypi/v/yte)
[![Conda Recipe](https://img.shields.io/badge/recipe-yte-green.svg)](https://anaconda.org/conda-forge/yte)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/yte.svg)](https://anaconda.org/conda-forge/yte)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/yte.svg)](https://github.com/conda-forge/yte-feedstock)


YTE is a template engine for YAML format that utilizes the YAML structure in combination with Python expressions for enabling to dynamically build YAML documents.

The key idea of YTE is to rely on the YAML structure to enable conditionals, loops and other arbitrary Python expressions to dynamically render YAML files.
Python expressions are thereby declared by prepending them with a `?` anywhere in the YAML.
Any such value will be automatically evaluated by YTE, yielding plain YAML as a result.
Importantly, YTE templates are still valid YAML files (for YAML, the `?` expressions are just strings).

Documentation of YTE can be found at https://yte-template-engine.github.io.

## Comparison with other engines

Lots of template engines are available, for example the famous generic [jinja2](https://jinja.palletsprojects.com).
The reasons to generate a YAML specific engine are

1. The YAML syntax can be exploited to simplify template expression syntax, and make it feel less foreign (i.e. fewer special characters for control flow needed) while increasing human readability.
2. Whitespace handling (which is important with YAML since it has a semantic there) becomes unnecessary (e.g. with jinja2, some [tuning](https://radeksprta.eu/posts/control-whitespace-in-ansible-templates) is required to obtain proper YAML rendering).

Of course, YTE is not the first YAML specific template engine.
Others include

* [Yglu](https://yglu.io)
* [Emrichen](https://github.com/con2/emrichen)

The main difference between YTE and these two is that YTE extends YAML with plain Python syntax instead of introducing another specialized language.
Of course, the choice is also a matter of taste.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yte-template-engine/yte",
    "name": "yte",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Johannes K\u00f6ster",
    "author_email": "johannes.koester@tu-dortmund.de",
    "download_url": "https://files.pythonhosted.org/packages/58/4b/3f89f96417e4e39c3f3e3f4a17d6233e81dc1e5cd5b5ed0a2498faedf690/yte-1.5.4.tar.gz",
    "platform": null,
    "description": "# YTE - A YAML template engine with Python expressions\n\n[![Docs](https://img.shields.io/badge/user-documentation-green)](https://yte-template-engine.github.io)\n[![test coverage: 100%](https://img.shields.io/badge/test%20coverage-100%25-green)](https://github.com/yte-template-engine/yte/blob/main/pyproject.toml#L30)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/yte-template-engine/yte/testing.yml?branch=main)\n![PyPI](https://img.shields.io/pypi/v/yte)\n[![Conda Recipe](https://img.shields.io/badge/recipe-yte-green.svg)](https://anaconda.org/conda-forge/yte)\n[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/yte.svg)](https://anaconda.org/conda-forge/yte)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/yte.svg)](https://github.com/conda-forge/yte-feedstock)\n\n\nYTE is a template engine for YAML format that utilizes the YAML structure in combination with Python expressions for enabling to dynamically build YAML documents.\n\nThe key idea of YTE is to rely on the YAML structure to enable conditionals, loops and other arbitrary Python expressions to dynamically render YAML files.\nPython expressions are thereby declared by prepending them with a `?` anywhere in the YAML.\nAny such value will be automatically evaluated by YTE, yielding plain YAML as a result.\nImportantly, YTE templates are still valid YAML files (for YAML, the `?` expressions are just strings).\n\nDocumentation of YTE can be found at https://yte-template-engine.github.io.\n\n## Comparison with other engines\n\nLots of template engines are available, for example the famous generic [jinja2](https://jinja.palletsprojects.com).\nThe reasons to generate a YAML specific engine are\n\n1. The YAML syntax can be exploited to simplify template expression syntax, and make it feel less foreign (i.e. fewer special characters for control flow needed) while increasing human readability.\n2. Whitespace handling (which is important with YAML since it has a semantic there) becomes unnecessary (e.g. with jinja2, some [tuning](https://radeksprta.eu/posts/control-whitespace-in-ansible-templates) is required to obtain proper YAML rendering).\n\nOf course, YTE is not the first YAML specific template engine.\nOthers include\n\n* [Yglu](https://yglu.io)\n* [Emrichen](https://github.com/con2/emrichen)\n\nThe main difference between YTE and these two is that YTE extends YAML with plain Python syntax instead of introducing another specialized language.\nOf course, the choice is also a matter of taste.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A YAML template engine with Python expressions",
    "version": "1.5.4",
    "project_urls": {
        "Homepage": "https://github.com/yte-template-engine/yte",
        "Repository": "https://github.com/yte-template-engine/yte"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "156497df1886abf11291e9a18b1672b2b79eb940499263c85339a1645d870600",
                "md5": "41670f117597e9cf6c58adbbc77ea2da",
                "sha256": "14ccfcb57d60b7652041b606129851423805140b22f52f5152f7c2692cd7b905"
            },
            "downloads": -1,
            "filename": "yte-1.5.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "41670f117597e9cf6c58adbbc77ea2da",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7655,
            "upload_time": "2023-12-11T09:14:59",
            "upload_time_iso_8601": "2023-12-11T09:14:59.202238Z",
            "url": "https://files.pythonhosted.org/packages/15/64/97df1886abf11291e9a18b1672b2b79eb940499263c85339a1645d870600/yte-1.5.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "584b3f89f96417e4e39c3f3e3f4a17d6233e81dc1e5cd5b5ed0a2498faedf690",
                "md5": "e272154166df82400e7090a7c9476241",
                "sha256": "d2d77e53eafca74f58234fcd3fea28cc0a719e4f3784911511e35e86594bc880"
            },
            "downloads": -1,
            "filename": "yte-1.5.4.tar.gz",
            "has_sig": false,
            "md5_digest": "e272154166df82400e7090a7c9476241",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6352,
            "upload_time": "2023-12-11T09:15:00",
            "upload_time_iso_8601": "2023-12-11T09:15:00.703465Z",
            "url": "https://files.pythonhosted.org/packages/58/4b/3f89f96417e4e39c3f3e3f4a17d6233e81dc1e5cd5b5ed0a2498faedf690/yte-1.5.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-11 09:15:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yte-template-engine",
    "github_project": "yte",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "yte"
}
        
Elapsed time: 0.42876s