Skip to main content

Jinja 2 file command line render

Project description

Jinja-to-file

Pypi link https://pypi.org/project/j2f/

Jinja2 to file command line

$ python j2f/j2f.py --vars vars.yml deploy.yml 
Traceback (most recent call last):
  File "j2f/j2f.py", line 58, in <module>
    rendered = jinja2file(args.template, template_vars)
  File "j2f/j2f.py", line 43, in jinja2file
    rendered = j2_env.get_template(template_file).render(template_vars)
  File "/home/jorge/.virtualenvs/j2f/lib/python3.5/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/home/jorge/.virtualenvs/j2f/lib/python3.5/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/jorge/.virtualenvs/j2f/lib/python3.5/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/home/j2f/deploy.yml", line 147, in top-level template code
    component_gitrevision: "{{ gitrevision }}"

then add the missing var 'component_gitrevision' to vars.yml file

- component_gitrevision: '123456'

and rerun the j2f script to render the template

build binary

For an easy way to use, a portable binary can be build using setup-bin.py

python setup-bin.py build

Project details


Download files

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

Source Distribution

j2f-0.0.3.tar.gz (1.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

j2f-0.0.3-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file j2f-0.0.3.tar.gz.

File metadata

  • Download URL: j2f-0.0.3.tar.gz
  • Upload date:
  • Size: 1.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.3

File hashes

Hashes for j2f-0.0.3.tar.gz
Algorithm Hash digest
SHA256 247634b0419721211391fa9dbbb257db11e0adb8c0cfeb34986c5387b54b625a
MD5 d93eda82ac77051d5b0206807335f63e
BLAKE2b-256 0c547bd451a09a1cb8a841b52964ea6a4b76de7cceab8fdfe30a8ed88fe030ef

See more details on using hashes here.

File details

Details for the file j2f-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: j2f-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.3

File hashes

Hashes for j2f-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 535a882fe490f9425b2bb56a8760aec069e9fd43ebdc549b86301bae7c9ec487
MD5 f70179524e96b77b94ac516d7cfcfe08
BLAKE2b-256 8e00d80874303a73b5aad92a020c833aa32f9f382b4505ea6260c83c2c686326

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page