Jinja2-TD

Jinja2 template dependency insight


Keywords
jinja, jinja2, template, dependency
License
MIT
Install
pip install Jinja2-TD==3.1.post2

Documentation

Jinja2-TD Read The Docs

Provides information about Jinja2 template dependencies.

Install

pip install Jinja2-TD==3.x.x

Example

...

my_template = env.get_template("my_template.j2")

...

template_info = env.dependencies.get_template("my_template.j2")

parent = template_info.get_parent()
if parent is not None:
   print("This template extends", parent.target.name)
else:
   print("This template doesn't extend another")

Go read the docs!