If the goal of p2cli is to support Jinja2 syntax, maybe have a look at https://github.com/noirbizarre/gonja. The documentation is unfortunately not up to date, but this library does support Jinja2 filters (e.g. {{ foo | default("bar") }}) as well as string concatenation with ~.
The library used for the template processing (https://github.com/flosch/pongo2) does process Django-syntax like templates. Therefore the claim in the README, that p2cli does process Jinja2 templates is a bit misleading (even though the syntax of the two is similar, for the differences see: https://jinja.palletsprojects.com/en/2.10.x/switching/#django).
If the goal of p2cli is to support Jinja2 syntax, maybe have a look at https://github.com/noirbizarre/gonja. The documentation is unfortunately not up to date, but this library does support Jinja2 filters (e.g.
{{ foo | default("bar") }}
) as well as string concatenation with~
.