Saravanan666/pypi-org huggingface dataset:
Package: jinja2html
jinja2htmljinja2html takes your jinja2 templates and outputs HTML.More importantly, it supports developer-friendly live reloading so that you can create that masterpiece of a static website without ripping your hair out.Why jinja2html?Blogging frameworks are adime a dozen.  But what if you don't want to write a blog?  What if you wanted to make a static landing page, but without all that client-heavy nonsense like React/Vue/Angular/etc?That's where jinja2html comes in.No fancy bells and whistles, no bull$hit, just your bold artistic vision + jinja2html.Installpipinstalljinja2htmlThis installs the CLI command,jinja2html, which can be used to generate html or start the local development server.Usageusage: __main__.py [-h] [-d] [-p port] [-i input_dir] [-o output_dir] [-t template_dir] [--debug] [--ignore ignored_dir [ignored_dir ...]]

Render jinja2 templates as html/css/js

optional arguments:
  -h, --help            show this help message and exit
  -d                    enable development mode (live-reload)
  -p port               serve website on this port
  -i input_dir          The input directory (contianing jinja templates) to use. Defaults to the current working directory.
  -o output_dir         The output directory to write website output files to. Defaults to ./out
  -t template_dir       Shared templates directory (relative path only, this must be a subfolder of the input directory). Defaults to templates
  --debug               Enables debug level logging
  --ignore ignored_dir [ignored_dir ...]
                        directories to ignoreExamples# generate html files for use in prodjinja2html# run in dev mode, in the current directoryjinja2html-d# generate html files for use in prod and ignore folders Foo/ and Bar/jinja2html-d--ignoreFoo/Bar/# run in dev mode, on port 8080 and ignore folder hello/world/jinja2html-d-p8080--ignorehello/world/Seeherefor an example projectScopejinja2html is designed for small and simple static websites.  If you're trying to do something big and complex, then you should stick with the tooling of a conventional front-end framework.
Package: jinja2-humanize-extension
jinja2_humanize_extensionStatus (master branch)What is it ?This is ajinja2extension to usehumanizelibrary inside jinja2 templates.SyntaxThe generic syntax is{{ 'VALUE'|humanize_{humanize_fn}([humanize_fn_args]) }}.Followinghumanizefunctions are currently mapped:naturalsizeabs_timedelta(deprecated with humanize >= 4.0, we keep it for compatibility)date_and_delta(deprecated with humanize >= 4.0, we keep it for compatibility)naturaldatenaturaldaynaturaldeltanaturaltimeprecisedeltaordinalintcommaintwordapnumberfractionalscientificclampmetricactivatedeactivatethousands_separatordecimal_separatorSeehumanizedocumentation for argument details.To take a more real example, let's take thenaturalsize()function. To use it inside ajinja2template with this extension, you
have to use:The file size is: {{ 30000000|humanize_naturalsize(binary=False, gnu=True) }}result content will be :The file size is : 30.0 MBYou can use the same logic with all supported functions. If you need other functions, feel
free to open a PullRequest.Installationpip install jinja2-humanize-extensionFull examplefromjinja2importTemplate,Environment# We load the extension in a jinja2 Environmentenv=Environment(extensions=["jinja2_humanize_extension.HumanizeExtension"])template=env.from_string("The file size is : {{ 30000000|humanize_naturalsize() }}")result=template.render()# [...]result content will be :The file size is : 30.0 MBContributing 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-importmap
jinja2-importmapThis package provides a simple tool for generating import maps from a directory
in the usualnode_modulesformat.This can be done either from a directory, or from the contents of a Python package,
for example if lists vendored JS dependencies in MANIFEST.in.Use from Command LineThis package also provides a matching command line tool,jinja2_importmap:$jinja2_importmapdemo/node_modules--prefix="url/prefix"19.7.0jinja2-importmap{"imports":{"codemirror":"url/prefix/codemirror/dist/index.js","crelt":"url/prefix/crelt/index.es.js",".yarn-integrity":"url/prefix/None","w3c-keyname":"url/prefix/w3c-keyname/index.es.js","@codemirror/lint":"url/prefix/@codemirror/lint/dist/index.js","@codemirror/autocomplete":"url/prefix/@codemirror/autocomplete/dist/index.js","@codemirror/language":"url/prefix/@codemirror/language/dist/index.js","@codemirror/state":"url/prefix/@codemirror/state/dist/index.js","@codemirror/search":"url/prefix/@codemirror/search/dist/index.js","@codemirror/view":"url/prefix/@codemirror/view/dist/index.js","@codemirror/commands":"url/prefix/@codemirror/commands/dist/index.js","style-mod":"url/prefix/style-mod/src/style-mod.js","@lezer/highlight":"url/prefix/@lezer/highlight/dist/index.js","@lezer/common":"url/prefix/@lezer/common/dist/index.js","@lezer/lr":"url/prefix/@lezer/lr/dist/index.js"}}%You can also equivalently usepython -m jinja2_importmapto run the tool, or importjinja2_importmap.core.scan_packagesfor use in your own code.Use from Jinja TemplateCurrently, a custom parsed tag is not yet implemented. However, loading
thejinja2_importmap.ext.importmapextension will currently addimportmap(an alias toscan_packages) to the global namespace.{{importmap("web/static/vendor",package="my_package",prefix="static")}}The intention is to eventually provide:{%importmap"web/static/vendor"package="my_package"prefix="static"%}...or to allow overrides within a block:{%importmap"web/static/vendor"package="my_package"prefix="static"%}{# override automatically generated importmap with json provided here #}{%endimportmap%}
Package: jinja2_iso8601
Jinja2-ISO8601Addsparse_dateandformat_datefilters to Jinja.
Theiso8601module handles date parsing,
hence the name of this project. The.strftime()method handles date formatting.InstallFirst install the Python module:pipinstalljinja2-iso8601Then add the extension into your Jinja environment:fromjinja2importEnvironmentjinja_env=Environment(extensions=['jinja2_iso8601.ISO8601Extension'])UseYou can now use two new filters when writing your Jinja templates:parse_dateandformat_date.parse_datewill turn an ISO-8601 formatted string into aPythondatetimeobject.format_datewill call the.strftime()method on whatever you pass to it;
this works well withdatetime,date, andtimeobjects. You'll need to
provide a format string for theformat_datefilter;check the Python documentation for how to write a format string.For example, let's say you have a variable calleddatestrwhich is
a string representing a datetime in valid ISO-8601 format, such as"2022-09-19T14:38:34.213001". You can write your Jinja template like this:no filter:{{datestr}}parsed:{{datestr|parse_date}}formatted:{{datestr|parse_date|format_date("%a, %b %d %Y")}}and the rendered result will be:no filter: 2022-09-19T14:38:34.213001
parsed: 2022-09-19 14:38:34.213001
formatted: Mon, Sep 19 2022TimezonesIn Python, date and time objects may include timezone information.
Date and time objects that have an associated timezone are "aware", and
those that do not have an associated timezone are "naive".By default, when parsing ISO-8601 strings without any timezone information,
the result is a "naive" datetime object. However, in some cases, you may
want to assume a default timezone, so that you always get an "aware"
datetime object even if no timezone is specified. For example, if you know
that the ISO-8601 string is in the UTC timezone, you may want theparse_datefilter to return an "aware" datetime with the UTC timezone.Thedefault_timezonevalue on the Jinja environment controls which
timezone to use when none is specified in the string. By default, this
value isNone, which makesparse_datereturn a "naive" datetime.
Here's how to make all datetimes parse as UTC:fromdatetimeimporttimezonefromjinja2importEnvironmentjinja_env=Environment(extensions=['jinja2_iso8601.ISO8601Extension'])jinja_env.default_timezone=timezone.utcSee AlsoThese filters can be paired with other Jinja filters that process datetimes,
such asjinja2_humanize_extension.
You can parse strings into datetime using theparse_datefilter from this
project, and then "humanize" the datetime using thehumanize_naturaldayfilter
fromjinja2_humanize_extension. They work together seamlessly!
Package: jinja2_maps
jinja2_mapsis a set of filters to display locations in Jinja2 templates.Installpip install jinja2_mapsSupportServiceURLMapOpenStreetMapYesYesGoogle MapsYesApple MapsYesBing MapsYesMappyYesBoth Python 2.x and 3.x are supported.UsageAll filters take a location as a dict withlatitudeandlongitudekeys.
You can also pass an object with these attributes.Before using any template you need to add the filters to your Jinja2
environment:fromjinja2_mapsimportactivate_filtersactivate_filters(your_env)If using Flask you can do the following:fromjinja2_mapsimportactivate_filtersactivate_filters(app.jinja_env)URLs<ahref="{{your_location|osm_url}}">Check on OpenStreetMap</a><ahref="{{your_location|gmaps_url}}">Check on Google Maps</a><ahref="{{your_location|apple_maps_url}}">Check in Maps</a><ahref="{{your_location|bing_maps_url}}">Check on Bing Maps</a><ahref="{{your_location|mappy_url}}">Check on Mappy</a>URLs also support giving the zoom level (default is16):<ahref="{{your_location|osm_url(zoom=12)}}">Check on OpenStreetMap</a>Maps{{your_location|osm_map(width=500,height=400)}}
Package: jinja2_markdown
# Jinja2 Markdown extension [![Build Status](https://travis-ci.org/danielchatfield/jinja2_markdown.png)](https://travis-ci.org/danielchatfield/jinja2_markdown)A simple extension for adding a `{% markdown %}{% endmarkdown %}` tag to Jinja.## Installation`pip install jinja2_markdown`## Usage```pythonfrom jinja2_markdown import MarkdownExtensionjinja_env.add_extension(MarkdownExtension)```or```pythonjinja_env = Environment(extensions=['jinja2_markdown.MarkdownExtension'])```## Features### Automatic whitespace gobbleThis works:```<article class="article container-very-tight pad-medium highlight-first">{% markdown %}Terms of Service================In short, we run this website called Volcanic Pixels and you are morethan welcome to use it and the products distributed through it. All weask is that you don't use it for things which are illegal or harmful.***...{% endmarkdown %}</article>```## Want a new feature? Bug report?Open an issue on github, or better submit a pull request.
Package: jinja2-matrix-filters
Jinja2 Matrix FiltersOverviewJinja2 Matrix Filters is a functionality extension to handle matrix data.Included filtersuser_bridge_infouser_bridge_prefixuser_bridge_account_iduser_homeserverlocation_message_geo_urilocation_message_latitudelocation_message_longitudegoogle_location_urlInstallpip install jinja2-matrix-filtersUsageTypical usage with jinja2fromjinja2importEnvironment...env=Environment(extensions=['jinja2_matrix_filters.MatrixFiltersExtension'])...# ORfromjinja2_matrix_filtersimportMatrixFiltersExtensionenv=Environment(extensions=[MatrixFiltersExtension])...Include into cookiecuttercookiecutter.json{"_extensions":["jinja2_matrix_filters.MatrixFiltersExtension"]}
Package: jinja2-mjml
Jinja2 MJMLMicro-package that integratesMJMLwithJinja2.Under the hood it usesmjml_pythonpackage, that is a wrapper aroundrust portof MJML.Examplefromjinja2_mjmlimportEnvironment# MJMLEnvironment it's thin wrapper around jinja2.Environment,# so you can use all the features of Jinja2 package.environment=Environment()template=environment.from_string('''<mjml><mj-body><mj-section><mj-column><mj-text>Hello {{ name }}!</mj-text></mj-column></mj-section></mj-body></mjml>''')# Render MJML template to HTMLprint(template.render(name='MJML'))
Package: jinja2-neverundefined
Jinja: NeverUndefinedEnd the lawless era of Jinja.NeverUndefinedis more restrictive thanStrictUndefined. Seethis issue.UsageInstall the package:pip3installjinja2_neverundefinedCreate a template file namedtemplate.j2with the following content:{%macrotest(a,b,c)%}a macro with three parameters but not used{%endmacro%}{{test()}}Create a Python script namedexample.pywith the following content:fromjinja2importEnvironment,FileSystemLoaderfromjinja2_neverundefinedimportNeverUndefined# Create Jinja2 environment with the extensionenv=Environment(loader=FileSystemLoader('.'),undefined=NeverUndefined)# Render the templatetemplate=env.get_template('template.j2')rendered=template.render()# Print the rendered outputprint(rendered)Run the script:python3example.pyThe script will raise an exception because parametersa b care not provided when calling macrotestin the template.Take another example:{%macromtest(a,b,c)%}append undefined parameters to list{%sets=[]%}{%dos.append(a)%}{{s}}{%endmacro%}{{mtest()}}StrictUndefinedwill not throw error. It will produce:append undefined parameters to list
[Undefined]However,NeverUndefinedwill:File "template.j2", line 9, in top-level template code
    {{ mtest() }}
      └ <Macro 'mtest'>
  File "/usr/local/lib/python3.9/dist-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
         │           └ [missing, missing, missing]
         └ <Macro 'mtest'>
  File "template.j2", line 2, in template
    {% macro mtest(a, b, c) %}
  File "/usr/local/lib/python3.9/dist-packages/jinja2_neverundefined/__init__.py", line 14, in __init__
    raise Exception(info)
                    └ "parameter 'a' was not provided"
Exception: parameter 'a' was not providedBy using theNeverUndefinedextension, the Jinja environment will raise an exception when encountering an undefined variable. This helps catch potential issues or missing variable bindings in your templates.
Package: jinja2-orcid-extension
Jinja2 ORCID extensionExtension with custom filters replacing ORCIDs with elements
from the orcid records.Free software: MIT licenseDocumentation:https://jinja2-orcid-extension.readthedocs.io.Before we begin…It is important to note that this package was created for
one specific use case, namely to be used as a jinja2
extension while generating project structures with cookiecutter
through the cookiecutter CLI interface. The goal is to make
the information in the ORCID records available for researchers
who are using cookiecutter for data management puposes,
but are otherwise unfamiliar with programming.The package works by adding custom jinja2 filters that perform
a call to the ORCID REST API at the time of template rendering.
Using this package in another context (e.g. in the context
of a web framework), will likely be a bad idea. Fetching data
in this way will not be in lign with the design principles of
the framework you are using. Using it in those contexts will
make error handling, automated testing and debugging more difficult.FeaturesThe package contains filter expressions which you can use on valid
ORCIDS in Jinja2 templates. Each filter replaces the ORCID in
the template with a string containing certain elements from
the ORCID record. Currently several filters are available:full_credit: returns a single preformated label containing the credit name and orcid id.credit_name: contains the credit name as supplied in the ORCID recordgiven_names: contains the given names as supplied in the ORCID recordfamily_name: contains the family name as supplied in the ORCID recordCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0.dev1 (2022-03-04)First development release on PyPI.
Package: jinja2-ospath
A Jinja2 extension that introduces the template filtersbasenameanddirname.Examplesmy_path="/some/absolute/path/with/file.txt"{{my_path|basename}}Will fill in'file.txt'.my_path="/some/absolute/path/with/file.txt"{{my_path|dirname}}Will fill in'/some/absolute/path/with'.Copyright and LicensingCopyright 2017,Moritz Emanuel BeberFree software:3-Clause BSD License
Package: jinja2-pdoc
jinja2-pdocjinja2extension based onpdocto embedd python code directly from modules or files into yourjinjatemplate.Installationpip install jinja2_pdocUsageCLILibrarySyntax{% pdoc <module>:<object>:<pdoc_attr[.str_attr]> %}see alsoExample<module>module name or path to python filepathlibexamples/example.pyExample:{% pdoc pathlib %}<object>class and/or function names, eg. frompathlibPathPath.openExample:{% pdoc pathlib:Path %}<pdoc_attr>pdocattributesdocstring- docstring of the objectsource- source code of the objectcode- plane code from functions, without def and docstringExample:{% pdoc pathlib:Path:docstring %}[.str_attr]optionalstrfunctions can be added to<pdoc_attr>with a dotdedent- removes common leading whitespace, seetextwrap.dedentindent- format code with 2 spaces for indentation, seeautopep8.fix_codeupper- converts to upper caselower- converts to lower caseExample:{% pdoc pathlib:Path.open:code.dedent %}ExamplesCommand Line>>> jinja2pdoc .\examples\ --force

rendering.. example.md>>> jinja2pdoc --help

Usage: jinja2pdoc [OPTIONS] INPUT [OUTPUT]

  Render jinja2 templates from a input directory or file and write to a output
  directory.

  if the `input` is a directory, all files with a matching `pattern` are
  renderd.

  if no `output` is given, the current working directory is used.

Options:
  -p, --pattern TEXT  template search pattern for directories
  -f, --force         overwrite existing files
  -n, --newline TEXT  newline character
  --help              Show this message and exit..Librarypython code to render a template directly from a stringfromjinja2_pdocimportjinja2,Jinja2Pdocenv=jinja2.Environment(extensions=[Jinja2Pdoc])s="""# jinja2-pdocembedd python code directly from pathlib using a jinja2 extension based on pdoc## docstring from pathlib.Path{% pdoc pathlib:Path:docstring %}## source from pathlib.Path.open```python{% pdoc pathlib:Path.open:source.indent -%}```"""code=env.from_string(textwrap.dedent(s)).render()Path("example.md").write_text(code)Resultoutput of thecodeabove# jinja2-pdocembedd python code directly from pathlib using a jinja2 extension based on pdoc## docstring from pathlib.PathPurePath subclass that can make system calls.

Path represents a filesystem path but unlike PurePath, also offers
methods to do system calls on path objects. Depending on your system,
instantiating a Path will return either a PosixPath or a WindowsPath
object. You can also instantiate a PosixPath or WindowsPath directly,
but cannot instantiate a WindowsPath on a POSIX system or vice versa.## source from pathlib.Path.open```pythondefopen(self,mode='r',buffering=-1,encoding=None,errors=None,newline=None):"""Open the file pointed by this path and return a file object, asthe built-in open() function does."""if"b"notinmode:encoding=io.text_encoding(encoding)returnio.open(self,mode,buffering,encoding,errors,newline)```
Package: jinja2-pimport
Jinja2 Extension for Python Import keywordsSo we don’t have to write a new jinja2 filter just for simple function.It exposed a powerful weapon for shoot you feet, use it in your own risk!UsageExecute “echo hello” shell command and get the outputfrom jinja2 import Environment

env = Environment(extensions=['jinja2_pimport.PImportExtension'])
template = env.from_string("{{ ('subprocess'|pimport).check_output('echo hello', shell=True).strip().decode() }}")
template.render()
# => helloLicenseDistributed under the terms of theMITlicense, jinja2-pimport is free and open source software
Package: jinja2_pluralize
Jinja2 pluralize filters.Free software: BSD licenseDocumentation:http://jinja2-pluralize.readthedocs.orgFeaturesSimple pluralize filter based on inflect.py. For example, this renders asgeese:{{'goose'|pluralize}}Django-style pluralize filter. Works as described in theDjango docs. For example, this renders asvotes:vote{{0|pluralize}}UsageTo use it with Jinja2, update thefiltersdict on the environment like this:fromjinja2importEnvironmentfromjinja2_pluralizeimportpluralize_djenv=Environment()env.filters['pluralize']=pluralize_djtmpl=env.from_string('vote{{ 0|pluralize }}')asserttmpl.render()=='votes'History0.3.0 (2015-10-09)Fix RST formatting on PyPI.Stable status.Test on Python 3.4 and 3.5.Add more badges to README.0.2.1 (2014-07-09)Remove the shebang from__init__.py(#2), thanks to@dashea.0.2.0 (2014-07-02)Package works as per the README.0.1.0 (2014-04-25)First release on PyPI.
Package: jinja2-pluralize-filter
Simple jinja2 filter to choose correct plural form for Russian language.Installationpip install jinja2-pluralize-filterYou need to register filter on the template environment:from pluralize import pluralize
environment.filters[‘pluralize’] = pluralizeor in Flask:from flask import current_app
from pluralize import pluralizeapp.template_filter(‘pluralize’)(pluralize)Example of usage:{{ results_count|pluralize([‘товар’, ‘товара’, ‘товаров’]) }}
Package: jinja2-precompiler
Pre-compile Jinja2 templates to Python byte code.UsageJinja2 pre-compiler comes with a utility script calledjinja2precompiler.
Please typejinja2precompiler--helpat the shell prompt to
know more about this tool.Compiling the Jinja2 templateThen runjinja2precompilercommand:$ jinja2precompiler templates
Compiling into folder "templates"
...
Compiled "templates/template.html" as tmpl_5f0fcb0ed56efa600c50d9f2870192327823c063.py
...
Finished compiling templatesWill compiling to Python byte code with--pycoption:$ jinja2precompiler --pyc templates
Compiling into folder "templates"
...
Compiled "templates/template.html" as tmpl_5f0fcb0ed56efa600c50d9f2870192327823c063.pyc
...
Finished compiling templatesGet the compiled module nameWill return a module file name with--modulenameoption:$ jinja2precompiler --modulename templates/template.html
tmpl_41d3b4a4b71afe0c223778e57c23244caee1baec.py

$ jinja2precompiler --modulename --pyc templates/template.html
tmpl_41d3b4a4b71afe0c223778e57c23244caee1baec.pycAnd you can prepend directory path with--baseoption:$ jinja2precompiler --modulename --base=templates templates/template.html
templates/tmpl_5f0fcb0ed56efa600c50d9f2870192327823c063.pyWill return module file names you specify the argument more than one:$ jinja2precompiler --modulename a.html b.html c.html
tmpl_25e7e8960b03ecb19189f36b8ef611389397c95c.py tmpl_83d0d31e29a7746a19536d616218a384f62d4694.py tmpl_45ecd51cee2d33904a8cd1af7c441dd3fc320870.pyWith MakeAn exampleMakefilefile:templates_compiled.zip: $(wildcard templates/*.html)
      jinja2precompiler -c templates
      zip -FS -j templates_compiled.zip templates/*.pycWill compiling only updated files and storing into the zip file.InstallationInstalling from PyPI usingpip:pip install jinja2precompilerInstalling from PyPI usingeasy_install:easy_install jinja2precompilerInstalling from source:python setup.py installDependenciesJinja2Changes0.2: supports walking symlink directoriesLicensingJinja2 pre-compiler is licensed under the terms of theBSD 3-Clause.Copyright 2012 ENDOH takanao.Projectsource codeis available at Github. Please report bugs and file
enhancement requests at theissue tracker.
Package: jinja2-python-version
A Jinja extension that creates a global variable with Python version
information for your Jinja2 templates:Compatible with Jinja2 versions 2.x and 3.x.Usage$pipinstalljinja2-python-versionfromjinja2importEnvironmentenv=Environment(extensions=['jinja2_python_version.PythonVersionExtension'])# 3.6template=env.from_string("{{ python_version }}")# 3.6template=env.from_string("{{ python_version.minor }}")# 3template=env.from_string("{{ python_version.major }}")# 3.6.4template=env.from_string("{{ python_version.micro }}")template.render()