Skip to main content

Compile Jinja templates with YAML variables

Project description


Compile Jinja templates using YAML variables!


pip install ynj


To use ynj you need yaml file with the variables, and a jinja template. An example values.yml file:

  name: John
  surname: Collins
    - name: "Python developer"
      technologies: [Pyton, SQL]
    - name: "Database administrator"
      technologies: [PostgreSQL, Oracle]

A sample template:

  <h1>{{ name }} {{ surname }}</h2>
{% for job in jobs %}
      <dt>{{ }}</dt>
      <dd>{{ ', '.join(job.technologies) }}</dd>
{% endfor %}

To fill the values into the template, run:

ynj < jobs.j2

You can override values also from command line:

ynj -t jobs.j2 -s "{name: Matt}"

More info: ynj -h.

Project details

Download files

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

Files for ynj, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size ynj-1.1.0.tar.gz (2.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page