yte
A YAML template engine with Python expressions
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 yteuv
uv add ytepoetry
poetry add yteInstalling 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
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
pyymlEmbeds Python expressions directly in YAML…
permissive · top 15,000 on PyPI
ruamel.yaml.jinja2Enables Jinja2 templating within YAML files by…
permissive · top 5,000 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
TempitaTempita is a lightweight templating engine that…
permissive · top 15,000 on PyPI
mkdocs-markdownextradata-pluginInjects mkdocs.yml extra variables into…
permissive · top 15,000 on PyPI
empyEmPy is a templating system that embeds Python…
permissive · top 15,000 on PyPI
sphinxcontrib.datatemplatesA Sphinx extension that renders…
permissive · top 15,000 on PyPI
zope.pagetemplatezope.pagetemplate provides a templating system…
unclear · top 15,000 on PyPI
dynamic-yamlAdds dynamic string interpolation to YAML…
permissive · top 15,000 on PyPI
jinjanatorA command-line tool that renders Jinja2…
permissive · top 5,000 on PyPI