Saravanan666/pypi-org huggingface dataset:
Package: jinja-gen
Jinja GeneratorInstallationFrom PyPI Repository$pipinstalljinja-genFrom Source$pipinstall-U.Usageusage: jinja-gen [-h] [-f] [-c] [-o] [--dry] [-k] [-d] [--debug] [--exec]
              [--no-dump]

Jinja Generator

optional arguments:
  -h, --help            show this help message and exit
  -f , --file           Path to the Jinja2 template file
  -c , --config         Path to the YAML configuration file, defaults to
                        <file_basename>.yaml
  -o , --output-dir     Output directory for generated files, defaults to
                        configuration file name
  --dry                 A dry run showing files to be generated
  -k , --output-name-key 
                        An extra key identifier populated for template with
                        name
  -d , --output-dir-key 
                        An extra key identifier populated for template with
                        output directory
  --debug               Enable debugging
  --exec                Enable executable file outputs
  --no-dump             Flag to disable a deterministic dump of the
                        configuration fileExamplesSee sample files inexamplesfolder.$ jinja-gen -f examples/sample.sh -c examples/sample.yamlTo enable executable file outputs,$ jinja-gen -f examples/sample.sh -c examples/sample.yaml --execLicenseMIT
Package: jinja_kit
Collestion of utilities and extensions for jinja2.INSTALLATIONTo use jinja-kit usepiporeasy_install:pip installjinja-kitoreasy_installjinja-kitDJANGO USAGEAddedjinja_kit.contrib.djangoto yourINSTALLED_APPS:INSTALLED_APPS+='jinja_kit.contrib.django',JINJA_FILTERTS=["jinja_kit.contrib.django.filters","myapp.filters"]JINJA_GLOBALS=["jinja_kit.contrib.django.globals",]CONTRIBUTEForkhttps://github.com/lispython/jinja-kit/, create commit and pull request.
Package: jinjalint
# jinjalintA prototype linter which checks the indentation and the correctness of[Jinja][jinja]-like/HTML templates. Can [fix issues][django-commit].It works with [Django’s templates][djangotemplates] too, it shouldwork with [Twig](https://twig.symfony.com/) and similar template languages.It should work fine with any kind of HTML 4 and 5, hovewer XHTML is notsupported.This linter parses both HTML and Jinja tags and will report mismatchedtags and indentation errors:```html+jinja<div>{% if something %}</div>{% endif %}``````html+jinja<div><span></div></span>``````html+jinja{% if something %}<div> not indented properly</div>{% endif %}``````html+jinja{% if something %}<a href="somewhere">{% endif %}<p>something</p>{% if not something %}</a>{% endif %}```## UsageYou need Python 3. Jinjalint doesn’t work with Python 2. Install it with`pip install jinjalint` (or `pip3 install jinjalint` depending on how `pip` iscalled on your system), then run it with:```sh$ jinjalint template-directory/```…or:```sh$ jinjalint some-file.html some-other-file.html```This is a work in progress. Feel free to contribute :upside_down_face:[jinja]: http://jinja.pocoo.org/docs/2.9/[django-commit]: https://github.com/django/djangoproject.com/commit/14a964d626196c857809d9b3b492ff4cfa4b3f40[djangotemplates]: https://docs.djangoproject.com/en/1.11/ref/templates/language/
Package: jinjalive
Welcome to JinjaLive documentation!JinjaLive is a project created by Marlysys.JinjaLive can be used to test your Jinja templates.
It renders a Jinja template with given variables to a rendered output. As simple as that !ContentsInstallationUsageCommand-line usageWeb applicationTestsApache configuration (optional)ContributingInstallationJinjaLive is available onpip:pipinstalljinjaliveUsageCommand-line usageGiven a context file and a template file, JinjaLive will generate the output file:jinjalive-cf<context_file>-tf<template_file>-of<output_file>Web applicationLaunch the JinjaLive server with:jinjalive-serverOpen your browser tohttp://<your_ip_address>:8888TestsJinjaLive embeds unittests to ensure both functionnalities coverage but also Python code quality.The test suite can be launched withtox:cdjinjalivesudopipinstall-rtest-requirements.txttoxApache configuration (optional)If you want to serve the JinjaLive web application behind Apache, please use WSGI.sudoapt-getupdatesudoapt-getinstallapache2libapache2-mod-wsgisudoa2enmodwsgiHere is a sample Apache virtualhost:<VirtualHost*:80>WSGIDaemonProcessjinjalivethreads=5WSGIScriptAlias/jinja/usr/local/lib/python2.7/dist-packages/jinjalive/jinjalive.wsgi<Directory/usr/local/lib/python2.7/dist-packages/jinjalive>WSGIProcessGroupjinjaliveWSGIApplicationGroup%{GLOBAL}WSGIScriptReloadingOnRequireallgranted</Directory>ErrorLog${APACHE_LOG_DIR}/jinjalive.error.logCustomLog${APACHE_LOG_DIR}/jinjalive.access.logcombined</VirtualHost>Your JinjaLive web application is now available underhttp://<your_ip_address>/jinja.ContributingRequirementsJinjaLive needs the following requirements:Python.Bower.Nowadays,pythonshould ever be present on your system, butbowerusually requires proper installation.bowerrequiresnodejs. Here is the full procedure to install bower for Ubuntu:sudoapt-getupdatesudoapt-getinstallnodejsnpmsudonpminstall-gbowersudoln-s/usr/bin/nodejs/usr/bin/nodeGo to project directory:cdjinjaliveInstall bower requirements:bowerinstallInstall Python requirements and JinjaLive package with a virtualenv:mkvirtualenvjinjalivepipinstall-rrequirements.txtpythonsetup.pydevelop
Package: jinjaMarkdown
Jinja2 Markdown FilterThis package offers a markdown filter to can be used to convert markdown to html code within a jinja2 template.How to UseFirst install the packagepip install jinjaMarkdownImport and Add the extension to your jinja enviroment (this should be done in app.py for flask)#import package
 from jinjaMarkdown.markdownExtension import markdownExtension
 
 #add markdownExtension to enviroment (by default jinja_env)
 app.jinja_env.add_extension(markdownExtension)Use markdown filter as you would any other jinja filter{{ "# Hello World" | markdown }}The above code would be equivalent to"<p><h1>Hello World</h1></p>"If autoescape is on (as it is by default) this will not be rendered as html code and instead as a string.Autoescape can be turned off like so:{% autoescape false %}
 {{ "# Hello World" | markdown }}
 {% endautoescape %}Note:Malicious code can be run while autoescape is turned off, so please keep your code secure.Markdown Syntax in UseThe markdown syntax used in this package followsthis guide.Only the best practices for markdown are implemented. If you are getting an error while using this package ensure you follow best practice first and that the syntax you are using is not included below.Basic Syntax Not Included (yet)BlockquotesListsCode BlocksEscaping Characters and CodeReference linksLinks using angular brackets
Package: jinja-markdown
Jinja-MarkdownA jinja2 extension that adds a{% markdown %}tag powered withPyMdown Extensions.Installationpip install jinja_markdownUsagejinja_env=Environment(extensions=['jinja_markdown.MarkdownExtension'])orfromjinja_markdownimportMarkdownExtensionjinja_env.add_extension(MarkdownExtension)Then your templates can contain Markdown inside{% markdown %}/{% endmarkdown %}block tags.<article>{%markdown%}# Heading
Regular text

    print("Hello world!"){%endmarkdown%}</article>About indentationTo avoid issues is recommended that you don't indent the markdown code inside the tag.
If you prefer do it anyway, make sure the first line has the baseline indentation level.<!-- Supported but not recommended --><article>{%markdown%}# Baseline of identation
    Regular paragraph

        This will be interpreted as code</article>
Package: jinja-markdown2
jinja-markdown2Inspired by the originaljinja-markdown.Usesjinja2+markdown2to render markdown codeafterjinja's templating magic
(variable interpolation, etc.) is done. Critical difference between the naive:Markdown ->  HTML -> JinjaNotice, the above processes the markdownfirstand jinja templatinglast. Whilst
this approach technically works, it results in a myriad of problems with the resultant
HTML that markdown2 formulates.The flow is then:HTML -> Jinja -> MarkdownUsagePython:...fromjinja_markdown2importMarkdownExtensionjinja_env=...jinja_env.add_extension(MarkdownExtension)...Markdown:{% markdown %}

## Hello {{ world_name }}

{% endmarkdown %}
Package: jinjamator
Jinjamator is an automation framework built to make complex automation tasks as easy and boilerplate free as possible.FeaturesJinjamator currently has following features:run tasks written in python3run tasks written in jinja2register functions via content plugin system for python3 and jinja2 tasks, to have the same functionality.run standalone as CLI applicationrun as REST API daemon, exporting tasks via REST APIgathering of required user inputs, determined by code inspectionvalidation of user inputslog everthing to a database (daemon mode only, CLI is on roadmap)support of different (customer) environmentsdistributed operation (daemon mode only)output plugin system to further process data generated by tasks (e.g.: generate excel files from everthing)includes a simple single-page javascript webapp for running tasks (automatically generates wizards from the task code)Content Pluginscisco.aci (query apic)ssh (run commands via ssh)fsm (parse ssh outputs to objects via textfsm)logMany more to come.Output Pluginsconsole (print data to stdout)excel (create a xlsx from task data)apic (push data to cisco ACI)null (supress output)Many more to come.InstallationInstall jinjamator by running:pip3 install jinjamatorContributeIssue Tracker:https://github.com/jinjamator/jinjamator/issuesSource Code:https://github.com/jinjamator/jinjamatorRoadmapSelected Roadmap items:create documentation ;)refactor frontend webappinclude AAA for the APIrun ansible playbooks as tasksrun powershell codeFor documentation please refer tohttps://jinjamator.readthedocs.io/en/latest/LicenseThis project is licensed under the Apache License Version 2.0
Package: jinjamodificado
Jinja2 is a template engine written in pure Python.  It provides aDjangoinspired non-XML syntax but supports inline expressions and
an optionalsandboxedenvironment.NutshellHere a small example of a Jinja template:{% extends 'base.html' %}
{% block title %}Memberlist{% endblock %}
{% block content %}
  <ul>
  {% for user in users %}
    <li><a href="{{ user.url }}">{{ user.username }}</a></li>
  {% endfor %}
  </ul>
{% endblock %}PhilosophyApplication logic is for the controller but don’t try to make the life
for the template designer too hard by giving him too few functionality.For more informations visit the newJinja2 webpageanddocumentation.
Package: jinjanator-plugin-ansible
jinjanator-plugin-ansible: Makes Ansible's filters and tests available in JinjanatorThis plugin makes all of the filters and tests from the Ansible 'core'
collection available to templates being rendered using the Jinjanator
tool.Installationpip install jinjanator-plugin-ansibleUsageThe Ansible filters and tests can be used in templates using the same
names that would be used if the template was rendered by Ansible
itself.Release InformationAdditionsAdded Python 3.12 support.
[#5](https://github.com/kpfleming/jinjanator-plugin-ansible/issues/5)→ Full Changelog
Package: jinjanator-plugin-format-toml
jinjanator-plugin-format-toml: Provides TOML format (data input) support for JinjanatorThis plugin allows Jinjanator to parse TOML data for processing in
templates. The format can be selected using--format tomlor
autoselected by using a data file with a name ending with.toml.Installationpip install jinjanator-plugin-format-tomlUsageSuppose you have an NGINX configuration file template,nginx.j2:server {
  listen 80;
  server_name {{ nginx.hostname }};

  root {{ nginx.webroot }};
  index index.htm;
}And you have a TOML file with the data,nginx.toml:[nginx]hostname="localhost"webroot="/var/www/project"This is how you render it into a working configuration file:$jinjanatenginx.j2nginx.toml>nginx.confOptionsThis format does not support any options.Release InformationAdditionsAdded Python 3.12 support.
[#2](https://github.com/kpfleming/jinjanator-plugin-format-toml/issues/2)→ Full Changelog
Package: jinjanator-plugin-format-xml
jinjanator-plugin-format-xml: Provides XML format (data input) support for JinjanatorThis plugin allows Jinjanator to parse XML data for processing in
templates. The format can be selected using--format xmlor
autoselected by using a data file with a name ending with.xml.Installationpip install jinjanator-plugin-format-xmlUsageSuppose you have an NGINX configuration file template,nginx.j2:server {
  listen 80;
  server_name {{ nginx.hostname }};

  root {{ nginx.webroot }};
  index index.htm;
}And you have an XML file with the data,nginx.xml:<nginx><hostname>localhost</hostname><webroot>/var/www/project</webroot></nginx>This is how you render it into a working configuration file:$jinjanatenginx.j2nginx.xml>nginx.confOptionsprocess-namespaces: configures the XML parser to replace namespace
references in element names with the corresponding namespaces fromxmlnsattributes in the top-level element in the document.Release InformationAdditionsAdded Python 3.12 support.
[#2](https://github.com/kpfleming/jinjanator-plugin-format-xml/issues/2)→ Full Changelog
Package: jinja-psycopg
Jinja-PsycopgJinja-Psycopg is a bridge between thejinjatemplating engine
and psycopg3'stype-aware formatting.Basic Usagefromjinja_psycopgimportJinjaPsycopgfrompsycopg.sqlimportIdentifierquery="""\{% set sep = joiner('\nAND ') -%}SELECT * FROM {{ table }}WHERE{% for column, value in where %}{{- sep() | sql -}}{{ column }} = {{ value }}{%- endfor %};"""renderer=JinjaPsycopg()renderer.render(query,{"table":Identifier("people"),"where":[(Identifier("name"),"Simon"),(Identifier("year"),2015),(Identifier("subject"),Placeholder("subject")),],},)This script renders the following SQL.Strings will be automatically escaped,
Identifiers quoted and Placeholders wrapped with the placeholder syntaxSELECT*FROM"people"WHERE"name"='Simon'AND"year"=2015AND"subject"=%(subject)s;The Composed objectOk, that's not the whole story.The render() method returns a [psycopg.sql.Composed][],
which needs to be turned into a string by the backend:psycopg.connect("dbame=test")asconn:# Render to stringprint(composed.as_string(conn))# Or execute directlyconn.execute(composed,{"subject":"Math"})SqlTemplate and SqlTemplateModuleLike in jinja, you can save your templatestemplate=renderer.from_string("""\{% set config = { 'option': True } %}select field from {{ table }};""")And turn them into python modulesmodule=template.make_module({"table":Identifier("foo")})assertgetattr(sqlmodule.module,"config")['option']==True# Render to SQLcomposed=sqlmodule.render()Custom SQL Objects@dataclassclassTable:schema:strname:strdef__sql__(self):returnIdentifier(self.name,self.schema)renderer.render("select * from {{ table }}",{"table":Table("public","foo")})Custom EnvironmentsTo add your own global variables and filters
to the jinja Environment, you can subclass JinjaPsycopgclassCustomRenderer(JinjaPsycopg):def_prepare_environment(self):super()._prepare_environment()self._env.globals["foo"]=my_global_variableself._env.filters["bar"]=my_filterFilterspsycopgThis filter is appliedautomaticallyto all jinja blocks:{{ value }}is equivalent to{{ (value) | psycopg }}It stores the actual value inside a ContextVar,
replacing{{value}}with a placeholder like{dictionary_key}to later be passed to SQL.formatsqlTreat a string value as plain SQL, not as a literalALTER TABLE foo {{ 'ADD COLUMN html TEXT' | sql }}sqljoinSame as jinja'sjoinfilter,
but operates on SQL objects{{ [Identifier("foo"), Identifier("bar")] | sqljoin(',') }}
Package: jinjaq
JinjaQ (Work in progress)JinjaQis a simple and efficient library for generating SQL queries fromJinja2templates. It is type-friendly and offersasyncsupport, drawing significant inspiration from the excellent library atjinjasql.Documentationhttp://jinjaq.readthedocs.io/RequirementsPython 3.8+andJinja2 3.1.2+.InstallationInstall usingpip:pipinstalljinjaqor usingpoetry:poetryaddjinjaq
Package: jinjarecurse
jinjarecurse CLI toolJinja Recursive Templating for the CLI.  Recursively template one file or many
folders of many files like a config management languages allow, without the
whole config management language.  Useful if you're switching from managing an
application from config management to just docker and need some simple
templating logic.Installationpip install jinjarecurseExample Usage$ jinjarecurse --help
 jinjarecurse (CLI)

Usage:
    jinjarecurse --vars=VARS_FILE --input=INPUT_PATH --output=OUTPUT_PATH

Options:
    -v <file>, --vars   <file>
    -i <file>, --input  <file>
    -o <file>, --output <file>Single fileGiven a config file containing your variables e.g.vars.yaml:#comment: not available
root: /
number: 1
dictionary:
    street: 123 North Ave
    city: New York
    state: New York
list:
    - ABC
    - DEF
    - HJK
layer_1:
    layer_2:
        layer_3: lastAnd an input file jinja2 template e.g.i_file:# Top level
{{root}}
{{number}}
{{dictionary}}
{{list}}
{{layer_1}}

# Nested data

{{dictionary.street}}
{{dictionary.city}}
{{dictionary.state}}
{{layer_1.layer_2.layer_3}}You can populate it and specify an output filepath e.g.o_file:$ jinjarecurse -v example/vars.yaml -i example/i_file -o example/o_file
WARNING: example/o_file (output) exists and any conflicting files will be overwritten
Writing from example/i_file to example/o_fileContents of the output file e.g.o_file:# Top level
/
1
{'street': '123 North Ave', 'city': 'New York', 'state': 'New York'}
['ABC', 'DEF', 'HJK']
{'layer_2': {'layer_3': 'last'}}

# Nested data

123 North Ave
New York
New York
lastDirectoryYou can also template an entire directory e.g.i_dirat once. Note the
output files in the output directory will maintain the filenames from the
input directory:$ jinjarecurse -v example/vars.yaml -i example/i_dir -o example/o_dir
Writing from example/i_dir/i_file to example/o_dir/i_file
Writing from example/i_dir/i_file_1 to example/o_dir/i_file_1
Writing from example/i_dir/i_file_2 to example/o_dir/i_file_2TestsTo run the unit tests, first install the dependencies:$ pipenv install --dev .Then invoke pytest:$ pipenv run py.test -vvvsChangelogPlease see theReleasesandCHANGELOG.md.
Package: jinjarope
jinjaropeRead the documentation!How to installpipThe latest released version is available at thePython package index.pipinstalljinjaropeWith CLI:pipinstalljinjarope[cli]Quick guideJinjarope contains a range of Jinja2 loaders (including fsspec-based ones) as well as ajinja2.Environmentsubclass with added functionality.For debugging purposes, an FsSpec filesystem implementation for jinja2 loaders is also included.FsSpecFileSystemLoaderThis loader can be used like a FileSystemLoader, but also works on any fsspec-supported
remote path.
Using thedir::prefix, any folder can be set as root.# protocol pathloader=jinjarope.FsSpecFileSystemLoader("dir::github://phil65:jinjarope@main/tests/testresources")env=jinjarope.Environment(loader=loader)env.get_template("testfile.jinja").render()# protocol and storage optionsloader=jinjarope.FsSpecFileSystemLoader("github",org="phil65",repo="jinjarope")env=jinjarope.Environment(loader=loader)env.get_template("README.md").render()# fsspec filesystemfs=fsspec.filesystem("github",org="phil65",repo="jinjarope")loader=jinjarope.FsSpecFileSystemLoader(fs)env=jinjarope.Environment(loader=loader)env.get_template("README.md").render()FsSpecProtocolPathLoaderThis loader accepts any FsSpec protocol path to be used directly.
A complete protocol URL to the template file is required.loader=jinjarope.FsSpecProtocolPathLoader()env=jinjarope.Environment(loader=loader)env.get_template("github://phil65:jinjarope@main/tests/testresources/testfile.jinja").render()NestedDictLoader[example]template="{{ something }}"content=tomllib.load(toml_file)loader=jinjarope.NestedDictLoader(content)env=jinjarope.Environment(loader=loader)env.get_template("example/template")General loader informationjinjaropealso contains subclasses for all defaultjinja2loaders. These loaders
have implementations for some magic methods (__eq__,__hash__,__repr__, ,__getitem__).loader=jinjarope.FileSystemLoader(...)template_source=loader["path/to/template.jinja"]The loaders can also get ORed to return a ChoiceLoader.choice_loader=jinjarope.FileSystemLoader(..)|jinjarope.PackageLoader(...)Prefix loaders can get created using pathlib-style string concatenationsprefix_loader="path_prefix"/jinjarope.FileSystemLoader(...)Additional filters / testsCheck out the documentation for a list of built-in filters and tests!
Package: jinja-script-block
Jinja2 ScriptIntroductionIn ERB, custom functions can be written in the template. However with jinja2, the functions should be written in python, and must be included in the rendering environment.Use Script Block{% script modulename %}
  # Your Python Code that should be in .py
{% endscript %}Define your python codes in script block. This is compiled before actual run starts.To use compiled block, do it as following:{{module.functions_you_defined()}}
{{module.values_you_defined()}}
{{module.function_with_arguments(1)}}
{{module.function_with_arguments_at_render(x)}}How to usefromjinja_script_blockimportScriptBlockExtensionfromjinja2importEnvironmentenv=Environment(extensions=[ScriptBlockExtension])env.from_string('''{% script mymodule %}class MyClass:containers = []{% endscript%}''')
Package: jinjasimplecli
Jinja Simple CLIThis project offers a way to easily compose templates directly from the
command line, ideal to use in junction with other cli utilities.You could check the examples under theexamplesdirectory and check the
By runningjinja-cli --helpon your terminal, you'll get all the basic functioning for the tool.BasicsIf you knowJinja, you will get how this works easily.INPUTortemplate, is the text stream or file that you are attempting to renderby default stdin.DATAorjson-data, is the text stream or file that contains the data used in the template and it's dependencies,by default is an empty json.ROOTortemplate-directory, is the search path for jinja'sFileSystemLoader.CONFIGorextensions-file, is a python file that contains functions that will be avalible to call from the templates, could be filters.OUTPUToroutput, is where to write the rendered template,by default is stdout.Remark: This is more related to*shscripting than this tool, but notice that we mention streams, so we could run the following commands and they would be equivalent in output.cat examples/templates/users.htm | jinja-cli -j examples/data/users.json
cat examples/data/users.json | jinja-cli -j - -i examples/templates/users.htm
jinja-cli -i examples/templates/users.htm -j examples/data/users.json
jinja-cli -i <(cat examples/templates/users.htm) -j <(cat examples/data/users.json)This is because the argument parsing for the input template and json data, was thinked in a way that you send any of does two as streams so we could use and compose with other cli tools.ExamplesAll the examples could be reproduced with the files in theexamplesdirectory.Curl in to a templateUsing the data variables you could fill templates pulling data from any kind of source, and insert it using standard input$ curl https://xkcd.com/2/info.0.json 2> /dev/null | jinja-cli -i examples/templates/xkcd.htm -j -
<article>
    <h2>Petit Trees (sketch)</h2>
    <img src="https://imgs.xkcd.com/comics/tree_cropped_(1).jpg"/>
    <p>'Petit' being a reference to Le Petit Prince, which I only thought about halfway through the sketch</p>
</article>Using Jinja FiltersYou could also use custom functions and call them as filters from yourconfigfile, eg.# fragment of examples/extensions.pyimportjinjasimplecli.extensionsasje@je.filter('issue')defhello_world(issue_number):url=f"https://api.github.com/repos/ekiim/jinjasimplecli/issues/{issue_number}"data=requests.get(url).json()returnf"Issue -{data['number']}-{data['title']}"So now running$ echo "{{ 1|issue }}" | jinja-cli -c examples/extensions.pywe getIssue - 1 - Merge Guide and Readme.Jinja other featuresWhen using template inheritance or referencing another template to import or include,
you should make reference to it, considering theROOTpath you provided.LicenseJinja Simple CLI is licensed under theBSD 3-Clause license.