Saravanan666/pypi-org huggingface dataset:
Package: jinja2-base64-filters
Tiny jinja2 extension to add b64encode and b64decode filters.Usagefromjinja2_base64_filtersimportjinja2_base64_filtersfromjinja2importEnvironmentenv=Environment(extensions=["jinja2_base64_filters.Base64Filters"])# "my_string" -> "bXlfc3RyaW5n"env.from_string("{{teststring|b64encode}}").render(teststring="my_string")# "bXlfc3RyaW5n" -> "my_string"env.from_string("{{teststring|b64decode}}").render(teststring="bXlfc3RyaW5n")Installationjinja2_base64_filtersis available for download from PyPI via pip:$ pip install jinja2-base64-filtersIt will automatically install jinja2RequirementsCompatibilityLicenceFree software: MIT licenseAuthorsjinja2_base64_filters was written byTimothée GERMAIN.This package was created withCookiecutterand thekragniz/cookiecutter-pypackage-minimalproject template.
Package: jinja2-cli-tddschn
$ jinja2A CLI interface to Jinja2Fork of jinja2-cliChangelogAdd -F to read value from filesInstallationpipxThis is the recommended installation method.$ pipx install jinja2-cli-tddschnpip$ pip install jinja2-cli-tddschnUsageUsage: jinja2 [options] <input template> <input data>

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  --format=FORMAT       format of input variables: auto, ini, json,
                        querystring, yaml, yml
  -e EXTENSIONS, --extension=EXTENSIONS
                        extra jinja2 extensions to load
  -D key=value          Define template variable in the form of key=value
  -F key=<path-to-file>, --file=key=<path-to-file>
                        Define template variable with a file content in the
                        form of key=<path-to-file>
  -s SECTION, --section=SECTION
                        Use only this section from the configuration
  --strict              Disallow undefined variables to be used within the
                        templateOptional YAML supportIfPyYAMLis present, you can use YAML as an input data source.$ pip install jinja2-cli-tddschn[yaml]Optional TOML supportIftomlis present, you can use TOML as an input data source.$ pip install jinja2-cli-tddschn[toml]Optional XML supportIfxmltodictis present, you can use XML as an input data source.$ pip install jinja2-cli-tddschn[xml]Optional HJSON supportIfhjsonis present, you can use HJSON as an input data source.$ pip install jinja2-cli-tddschn[hjson]Optional JSON5 supportIfjson5is present, you can use JSON5 as an input data source.$ pip install jinja2-cli-tddschn[json5]Develop$ git clone https://github.com/tddschn/jinja2-cli-tddschn.git
$ cd jinja2-cli-tddschn
$ poetry install
Package: jinja2-context-filters
Jinja2 Context FiltersOverviewThis Jinja2 Extension plugin provides filters that expose introspection values about the current Jinja2 Context and Environment objects for the current template's Environment().Included filterscontext_infoblocks(available blocks defined in this or a parent template)exported(vars exported from this template)global_vars(vars passed in to render)name(name of the current template object... often the template filename)vars(vars declared with set both here or from a parent)environment_infoextensionsfilterstestsInstallpip install jinja2-context-filtersUsageTypical usage with jinja2fromjinja2importEnvironment...env=Environment(extensions=['jinja2_context_filters.Jinja2ContextExtension'])...# ORfromjinja2_context_filtersimportJinja2ContextExtensionenv=Environment(extensions=[Jinja2ContextExtension])...In a template{{ 'name' | context_info }}
{{ 'blocks' | context_info }}
{{ 'exported' | context_info }}
{{ 'filters' | environment_info }}
{{ 'tests' | environment_info }}
{{ 'extensions' | environment_info }}Include into cookiecuttercookiecutter.json{"_extensions":["jinja2_context_filters.Jinja2ContextExtension"]}LicenseMIT License1.0.0 (2019-11-15)Bug FixesFixed setup.cfg by removing quotes from desc (ae45723)FeaturesAdded vars and global vars + tests 100% (677ca37)MIT LicenseCopyright (c) 2019 Global InfoTek, Inc.Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: jinja2-custom-filters-extension
Jinja2 Custom FiltersJinja2 offers manyfiltersto use in your template.
But this is limited.
This repo offers a number of additional filters that can be used in Jinja2 templates.How it worksThe first and foremost is installation.pip install jinja2_custom_filters_extensionAddextensionto your jinja environment.from jinja2_custom_filters_extension.string_filters_extension import StringFilterExtension
 environment: Environment = Environment(extensions=[StringFilterExtension])Use the filters that are available in the extension as you would use a built in  filter in your jinja templates.for ex:{{ "abc DEF" | upper_case_first_letter }}Render your template , the filters should be working.ExtensionsString Filter ExtensionFilter NameDescriptionExample Input ValueGenerated Output ValueslugChanges the value to lower case and then replaces spaces with dashesaBc DeF GHiabc-def-ghiupper_case_first_letterChanges only the first letter of the value to upper case.AbC DeFabC DeFUsage with cookiecuttercookiecutteris a famous tool for creating projects from project templates.Itis built on top ofjinja2.These extensions can also be used in a cookiecutter project.Make sure the packagejinja2_custom_filters_extensionis installed.Add extensions in thecookiecutter.jsonfile of your project.Refer thelinkon how to do it.
Bascially it is adding the below entry to the json."_extensions": ["jinja2_custom_filters_extension.string_filters_extension.StringFilterExtension"]Use the filters in your templates.Thats it. When you run your cookiecutter project, it should work.
Package: jinja2-django-tags
This little library contains extensions for jinja2 that add template tags to
jinja2 that you are used to from django templates.The following tags are included:csrf_tokentrans and blocktransnowstaticurlThere is also an extension for localizing template variables.RequirementsThis library requires at least Django 1.8 because there official jinja2 support
was added.If you want to use jinja2 templates in older versions of Django, take a look
atdjango-jinja.This library has been tested on Python 2.7, 3.4 and 3.5, Jinja 2.7 and 2.8, and Django 1.8, 1.9 and 1.10.For more information see thegithub page.
Package: jinja2-django-version
A Jinja extension that creates a global variable with Django version
information for your Jinja2 templates:Usage$pipinstalljinja2-django-versionfromjinja2importEnvironmentenv=Environment(extensions=['jinja2_django_version.DjangoVersionExtension'])# 2.0template=env.from_string("{{ django_version }}")# 2.0template=env.from_string("{{ django_version.minor }}")# 2template=env.from_string("{{ django_version.major }}")# 2.0.2template=env.from_string("{{ django_version.micro }}")template.render()
Package: jinja2-env
jinja2-envJinja2 Extension for getting environment variablesInstallationInstall this via pip (or your favourite package manager):pipinstalljinja2-envUsageThe extension class isjinja2_env.EnvExtension.As a statement:{% env "HOME" %}
{% env "HOME", default %}As a expression:{{ "default" | env("HOME") }}Contributors ✨Thanks goes to these wonderful people (emoji key):34j💻🤔📖This project follows theall-contributorsspecification. Contributions of any kind welcome!
Package: jinja2-error
Jinja2 Extension for Raise ErrorInstallationjinja2_erroris available for download fromPyPIviapip:$ pip install jinja2_errorIt will automatically installjinja2along witharrow.UsageError TagThe extension comes with aerrortag that provides convenient to raise error`.deftest_raise_error(self):env=Environment(extensions=[ErrorExtension])render_text="""
    {% if 1==1 %}
      {% error "It's error" %}
    {% endif %}
    """template=env.from_string(render_text)self.assertRaises(TemplateRuntimeError,template.render,{"a":"b"})Ansible Template UsageANSIBLE_JINJA2_EXTENSIONS=jinja2_error.ErrorExtensionansible-playbooksite.yml-vvvIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.Code of ConductEveryone interacting in the jinja2_error project’s codebases, issue trackers, chat
rooms, and mailing lists is expected to follow thePyPA Code of Conduct.LicenseDistributed under the terms of theMITlicense, jinja2_error is free and open source software
Package: jinja2-eval
jinja2-evalJinja2 Extension for gettingeval()result.InstallationInstall this via pip (or your favourite package manager):pipinstalljinja2-evalUsageBasic usage:{% eval "1 + 1" %}
{{ "1 + 1" | eval }}2
2Importing modules:{% eval "exec('import math') or math.pi" %}
{{ "exec('import math') or math.pi" | eval }}3.141592653589793
3.141592653589793Contributors ✨Thanks goes to these wonderful people (emoji key):34j💻🤔📖This project follows theall-contributorsspecification. Contributions of any kind welcome!
Package: jinja2-ext-custom-autoescaping
OverviewJinja2 extension to enable the use of any filter as a custom autoscape filter.This package allows you to define rules to determine when your custom autoescaping filter will be
enabled using the same 'select_autoescape' method you already use to determine
when the built-in autoescaping filter is enabled.Usagefrom jinja2_ext_custom_autoescaping import CustomAutoescapeExtension, enable_custom_autoescaping
from jinja2 import Environment, select_autoescape, FileSystemLoader

# Your custom filter...        
def my_filter(val):
    print(val)
    if isinstance(val, str):
        return val.replace(r"\\", r"\\\\")
    return val

    
# Here you set the rules for when the built-in autoescaping will be enabled
built_in_select_autoescape = select_autoescape(enabled_extensions=['html', 'htm', 'xml'],
                                               disabled_extensions=['txt', 'tex'],
                                               default_for_string=True,
                                               default=True)

# - select_autoescape is a closure
# - enabled_extensions takes precedence over disabled_extensions, so an extension in both lists will be enabled
# - You most likely do not want to have custom autoescaping on while built-in autoescaping is also on

# Here you set the rules for when your custom autoescaping will be enabled
custom_select_autoescape = select_autoescape(enabled_extensions=['tex', 'txt'],
                                             disabled_extensions=[],
                                             default_for_string=False,
                                             default=False)

# Just focusing on the important parts of your Environment construction.
env = Environment(extensions=[CustomAutoescapeExtension],
                  loader=FileSystemLoader(['.']),
                  autoescape=built_in_select_autoescape)

opts = {'custom_select_autoescape': custom_select_autoescape,
        'custom_autoescape_filter_name': 'my_filter',
        'custom_autoescape_filter_func': my_filter}

# Register the filter and enables autoescaping
enable_custom_autoescaping(env, **opts)

# Now you are ready to go...
template = env.get_template('test_template.txt')
print(template.render(var={'entry 1': 'value 1', 'entry2': r'val\\ue 2'}))
Package: jinja2-ext-path
jinja2-ext-path$ pip install jinja2-ext-pathUsageSeeExtensions - Adding Extensions.You would be able to use it like this:jinja_env=Environment(extensions=['jinja2_ext_path.basename','jinja2_ext_path.dirname'])Or:jinja_env.add_extension('jinja2_ext_path.dirname')Then you can render like this:jinja2_env.from_string("{{ '/home/user/test.txt'| dirname }}")For further reference:Python 3 — os.pathjinja2 — Template Designer Documentation - FiltersPlease note:currently methodsos.path.dirnameandos.path.basenameare included. Feel free to put in a PR.Installation$ pip install jinja2-ext-pathDevelopmentThis project usespre-commit.LicenseLicensed underGNU General Public License(Version 3, 29 June 2007).SeeLICENSE.md.
Package: jinja2-fnmatch-extension
jinja2_fnmatch_extensionStatus (master branch)What is it ?This is ajinja2extension to exposefnmatchfunction.SyntaxThe syntax is|fnmatch(pattern).Examplefromjinja2importTemplate,Environment# We load the extension in a jinja2 Environmentenv=Environment(extensions=["jinja2_fnmatch_extension.FnMatchExtension"])# For the example, we use a template from a simple stringtemplate=env.from_string("{{ 'foo-bar'|fnmatch('foo-*') }}")result=template.render()assertresult=="True"# [...]Contributing guideSeeCONTRIBUTING.mdfile.Code of ConductSeeCODE_OF_CONDUCT.mdfile.Sponsors(If you are officially paid to work on MetWork Framework, please contact us to add your company logo here!)
Package: jinja2-fsloader
A Jinja2 template loader using PyFilesystem2.AboutThis library allows you to use PyFilesystem2 as a backend to load templates into
Jinja2. You can take advantage of the wholefsecosystem, which already implements
drivers for FTP, SSH, SMB, S3, WebDAV servers, ZIP and Tar archives, andmany more!InstallationInstall withpip:$ pip install --user -U jinja2-fsloaderUsagefromjinja2_fsloaderimportFSLoaderFSLoader(template_fs,encoding='utf-8',use_syspath=False)template_fsaFSinstance or anFS URLwhere the templates are located.encodingthe encoding of the template files (utf-8by default).use_syspathset toTruefor the loader to return the real path or an URL to the template
when available (Falseby default).Examplesimportjinja2fromjinja2_fsloaderimportFSLoader# templates in a ZIP archiveenv=jinja2.Environment(loader=FSLoader("zip:///path/to/my/templates.zip"))# templates in a S3 bucketenv=jinja.Environment(loader=FSLoader("s3://mybucket"))# templates in memorymem=fs.open_fs('mem://')mem.settext('template.j2','This template is {{adjective}}')env=jinja.Environment(loader=FSLoader(mem))See AlsoThecomplete documentationof PyFilesystem2 can
give you a better overview of all the features available in the library.
Package: jinja2-gcp-secret-manager
jinja2-gcp-secret-managerJinja2 extension for fetching secrets GCP Secret ManagerInstallpipinstalljinja2-gcp-secret-managerUsage# template.j2
Secret is {% gcp_secret "secret-name" %}


# By default, the latest version is fetched, for specific version use:
2nd version of secret is {% gcp_secret "secret-name" version=2 %}

# If you are using Application default credentials or want to explicitly specify
the project where the secrets should be found, add the `project` term:
3rd version of secret is {% gcp_secret "secret-name" version=2 project="abc123" %}GCP SetupFor this to work, make sure you either setup theGOOGLE_APPLICATION_CREDENTIALSenvironment variable set to the correct file path or use Application default credentials.  Seehttps://google-auth.readthedocs.io/en/latest/user-guide.htmlfor more details.Note: If you use Application default credentials, you will need to specify project in allgcp_secrettags as default project cannot be determined as it can with a service account.
Package: jinja2-getenv-extension
jinja2_getenv_extensionStatus (master branch)What is it ?This is ajinja2extension to access to system
environment variables. It is usefull if you have dynamically generated
variable names.SyntaxThe syntax is{{ 'ENV_VAR'|getenv }}to access to theENV_VARenvironment
variable. Don't forget the quotes aroundENV_VAR!If you want to provide a default value to avoid an exception if the corresponding
environment variable does not exist, you can use the following syntax:{{ 'ENV_VAR'|getenv('default_value') }}.Examplesfromjinja2importTemplate,Environment# We load the extension in a jinja2 Environmentenv=Environment(extensions=["jinja2_getenv_extension.GetenvExtension"])# For the example, we use a template from a simple stringtemplate=env.from_string("the value of HOME environment variable is: ""{{ 'HOME'|getenv }}")result=template.render()# [...]Contributing guideSeeCONTRIBUTING.mdfile.Code of ConductSeeCODE_OF_CONDUCT.mdfile.Sponsors(If you are officially paid to work on MetWork Framework, please contact us to add your company logo here!)
Package: jinja2-git
Jinja2 extension to handle git-specific thingsInstallation$pipinstalljinja2-gitReasoningThis plugin is used to render commit hash injinja2templates. We are
using it to render our template version incookicutter:wemake-django-templatewemake-vue-templateUsageAdd it as an extension forjinja2orcookiecutter.And then inside a template:fromjinja2importEnvironmentenv=Environment(extensions=['jinja2_git.GitExtension'])template=env.from_string('Commit is: {% gitcommit %}')# => Commit is: c644682f4899d7e98147ce3a61a11bb13c52b3a0Or short version:fromjinja2importEnvironmentenv=Environment(extensions=['jinja2_git.GitExtension'])template=env.from_string('Commit is: {% gitcommit short=True %}')# => Commit is: c644682LicenseMIT
Package: jinja2-github
Jinja2 Extensions for rendering GitHub project properties.Available extensions are the following:github_repo_branch_sha: render the last commit SHA associated with
a GitHub project branch.github_repo_description: render the description of a GitHub project.Installationjinja2-githubis available for download fromPyPIviapip:$ pip install jinja2-githubIt will automatically installjinja2along withpygithub.Usagegithub_repo_branch_sha TagThe extension comes with agithub_repo_branch_shatag that allows to
render the last commit SHA associated with a GitHub project branch.By default, themasterbranch is used.fromjinja2importEnvironmentenv=Environment(extensions=['jinja2_github.GitHubRepoBranchShaExtension'])# Default branch is master -> "4f5191b50026f7281ca1b1cd180e05fad1d716c6"template=env.from_string("{% github_repo_branch_sha 'Slicer/Slicer' %}")template.render()It is also possible to specified a branch (or tag) name:fromjinja2importEnvironmentenv=Environment(extensions=['jinja2_github.GitHubRepoBranchShaExtension'])# With an explicit branch name -> "cfe12ceefd761502181660de76a8cc5d40d5f31c"template=env.from_string("{% github_repo_branch_sha 'Slicer/Slicer', 'master-48' %}")template.render()github_repo_descriptionThe extension comes with agithub_repo_descriptiontag that allows to
render the description of a GitHub project.fromjinja2importEnvironmentenv=Environment(extensions=['jinja2_github.GitHubRepoDescriptionExtension'])# -> "Multi-platform, free open source software for visualization and image computing."template=env.from_string("{% github_repo_description 'Slicer/Slicer' %}")template.render()IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.Maintainer: Making a releaseMake sure that all CI tests are passing onCircleCI.List all tags sorted by version$ git tag -l | sort -VChoose the next release version number$ release=X.Y.ZWarningTo ensure the packages are uploaded onPyPI, tags must match this regular
expression:^[0-9]+(\.[0-9]+)*(\.post[0-9]+)?$.Download latest sources$ cd /tmp && \
  git clone git@github.com:jcfr/jinja2-github && \
  cd jinja2-githubUpdate__version__injinja2_github.pyscript.$ sed -i "5s/.*/__version__ = '$release'/" jinja2_github.pyCommit and push the changes$ git add jinja2_github.py
$ git commit -m "jinja2-github $release"
$ git push origin masterTag the release$ git tag --sign -m "jinja2-github ${release}" ${release} origin/masterNoteWe recommend using aGPG signing keyto sign the tag.Publish the release tag$ git push origin ${release}ImportantThis will trigger builds on each CI services and automatically upload the wheels
and source distribution onPyPI.Check the status of the builds onCircleCI.Once the builds are completed, check that the distributions are available onPyPICode of ConductEveryone interacting in the jinja2-github project’s codebases, issue trackers, chat
rooms, and mailing lists is expected to follow thePyPA Code of Conduct.LicenseDistributed under the terms of theApache 2.0license, jinja2-github is free and open source software
Package: jinja2-hamlpy
Jinja2-HamlPy=============HamlPy extension for Jinja2.Basic Usage-----------To use this extension you just need to add it to you jinja environment and use ".haml" as extension for your templates.::from jinja2 import Environmentfrom jinja2_hamlpy import HamlPyExtensionenv = Environment(extensions=[HamlPyExtension])For Coffin Users:-----------------Simply add this to your settings::JINJA2_EXTENSIONS = ['jinja2_hamlpy.HamlPyExtension',]
Package: jinja2-highlight
jinja2-highlight################About=====A simple Jinja2 extension that uses Pygments to highlight code blocks... image:: https://travis-ci.org/tlatsas/jinja2-highlight.svg?branch=master:target: https://travis-ci.org/tlatsas/jinja2-highlightSource======Github: https://github.com/tlatsas/jinja2-highlightPypi: http://pypi.python.org/pypi/jinja2-highlightRequirements============* Jinja2 >= 2.4* Pygments >= 1.5Highlight examples=================::{% highlight 'language' %}your-awesome-code-here{% endhighlight %}Replace `language` with the appropriate Pygments lexer short name: http://pygments.org/docs/lexers/Line numbering can be turned on using `lineno='inline'` or `lineno='table'` depending on the style of line numbering you want (as per Pygment's documentation: http://pygments.org/docs/formatters/#HtmlFormatter)::{% highlight 'language', lineno='inline' %}your-awesome-code-here{% endhighlight %}This can also be used without a language setting::{% highlight lineno='table' %}your-awesome-code-here{% endhighlight %}Optional settings================By default Pygments renders the code block inside a div with the class 'highlight', if you want to change the name you can set the environment variable `jinja2_highlight_cssclass` to the class name you would like.In jinja this can be done after you've created your environment;::env = Environment(extensions=['jinja2_highlight.HighlightExtension'])# Set the css class name to 'codehilite'env.extend(jinja2_highlight_cssclass = 'codehilite')In Flask this can be done with the following (after creating your app):::app.jinja_env.extend(jinja2_highlight_cssclass = 'codehilite')Using with Flask================See the example at: https://github.com/tlatsas/jinja2-highlight/tree/master/examples/flask