skillfed

pyyml

Use python in yaml

pyyml v0.0.2 432.7K downloads/30d#6,706 on PyPI
Permissive license MIT Abandoned released

What it is and what it does

pyyml extends YAML parsing to allow Python code execution within YAML files. When you load a YAML file through pyyml, any expression wrapped in ${...} is evaluated as Python code and replaced with its result. You can also import packages at the top of your YAML file using a special # libs:[...] comment syntax, making those modules available to your expressions.

This is useful for configuration files that need computed values—file paths, sums, environment-dependent settings—without leaving YAML syntax. However, the package has received no maintenance since its initial release in April 2019 and depends on pyyaml, which has evolved significantly. The security model of executing arbitrary Python in YAML requires careful vetting of configuration sources.

Use it for:

  • Generate computed configuration values (e.g., derived paths, sums) directly in YAML without post-processing
  • Build environment-aware configs that reference os or other standard library modules within YAML
  • Reduce boilerplate by embedding simple Python logic in configuration files instead of wrapper scripts

Worth the install?

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

Embeds Python expressions directly in YAML files, evaluating them at parse time to generate dynamic configuration values.

No. The package is abandoned with no updates since April 2019, and its security model—executing Python code embedded in YAML—poses risks if configuration sources are untrusted. Modern alternatives or explicit post-processing of YAML are safer. Only consider it for legacy systems already using it.

Install

pyyml on PyPI

pip

pip install pyyml

uv

uv add pyyml

poetry

poetry add pyyml

Installing pyyml

Before you install

Low install friction with a single dependency (pyyaml), but the package has been abandoned since its initial release in April 2019 with no updates or maintenance.

License in practice

MIT license permits commercial and private use with minimal restrictions, though the abandoned status means no ongoing legal or security review.

Quickstart

from pyyml import load

with open('conf.yml') as f:
    config = load(f.read())

# YAML file with: sum: ${1 + 1}
# Results in: {'sum': 2}

Requires pyyaml as a runtime dependency; YAML files must use ${...} syntax for Python expressions and optional # libs:[...] header for imports.

Verify before relying

  • Whether the package works reliably with current Python versions, given its age and lack of maintenance
  • Security implications of executing arbitrary Python code embedded in YAML files during parsing
  • Compatibility with modern pyyaml versions and whether breaking changes have occurred

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — pyyaml
Maintenance abandoned — 2,684 days since the last release
First released
Downloads 432,712/month — #6,706 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyyml-0.0.2-py2.py3-none-any.whl

Tags

python expressions in yamldynamic yaml configurationyaml with code evaluationtemplated yaml filesyaml config with pythonexecutable yamlyaml python interpolation
yaml-templatingabandoned

More Markup packages