skillfed

yte

A YAML template engine with Python expressions

yte v1.9.4 168.8K downloads/30d#10,434 on PyPI44
Permissive license MIT AGING released

What it is and what it does

YTE is a template engine purpose-built for YAML that lets you embed Python expressions directly into YAML files to generate dynamic configurations. Instead of learning a separate templating syntax, you mark Python expressions with a `?` prefix anywhere in your YAML, and YTE evaluates them to produce plain YAML output. The key advantage is that YTE templates remain valid YAML files themselves—the `?` expressions are just strings to the YAML parser—and whitespace handling works naturally without the tuning required by generic engines like Jinja2.

The package depends on argparse-dataclass, dpath, and pyyaml to parse command-line arguments, navigate nested data structures, and handle YAML serialization. It's designed for developers who want to avoid learning a new templating language and prefer to write Python expressions in their YAML configurations instead.

Use it for:

  • Generate Kubernetes manifests or Docker Compose files with conditional blocks and loops based on deployment environment.
  • Build configuration files for infrastructure-as-code tools where Python logic simplifies conditional sections.
  • Template CI/CD pipeline definitions (GitHub Actions, GitLab CI) with dynamic job matrices and conditional steps.
  • Create parameterized YAML schemas for application config where expressions compute derived values.
  • Preprocess YAML data files with Python logic before passing them to downstream tools.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

YTE is a YAML template engine that embeds Python expressions directly into YAML files to dynamically generate YAML documents, using a `?` prefix to mark expressions for evaluation.

Yes, if you need to template YAML files and prefer Python expressions over a separate templating language. The low install friction, permissive license, and lack of security vulnerabilities make it a safe choice. The aging maintenance status is a minor concern—the project is stable and unarchived, but verify that the feature set and performance meet your needs before adopting it for critical workflows.

Install

yte on PyPI

pip

pip install yte

uv

uv add yte

poetry

poetry add yte

Installing yte

Before you install

Low install friction with a pure-Python wheel. Maintenance status is aging—last release was 260 days ago—but the repository remains active and unarchived, suggesting the project is stable rather than abandoned.

License in practice

MIT license is permissive, allowing use in commercial and proprietary projects with minimal restrictions beyond attribution.

Quickstart

pip install yte

import yte
rendered = yte.render_string('key: ? 1 + 1')
print(rendered)  # key: 2

Requires Python 3.8 or later (supports current versions up to Python 3.x).

Verify before relying

  • Whether YTE's performance is suitable for large or deeply nested YAML files.
  • How error messages and debugging experience compare to other YAML template engines.
  • Whether the package is actively maintained or in maintenance-only mode given the 260-day gap since last release.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 3 — argparse-dataclass, dpath, pyyaml
Maintenance aging — 260 days since the last release
Last repo commit
First released
Downloads 168,818/month — #10,434 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: yte-1.9.4-py3-none-any.whl

Tags

yaml template enginedynamic yaml generationpython yaml templatingyaml with expressionsyaml configuration templatingtemplate yaml filesyaml preprocessing
yaml-templatingconfiguration-generationpython-expressions

More Markup packages