jinjarope
jinjarope is a toolkit for Jinja2: an enhanced
Environment with a large set of extra filters, tests and globals, loaders for
fsspec filesystems and nested dicts, composable
loader classes, and TOML-based "JinjaFiles" to declare filters / tests / environment config.
Installation
pip install jinjarope
Optional extras: cli (command line interface), extras (formatting, highlighting, humanize,
natsort filters), httpx2 (alias httpx), icons (icon filters), llm (llm_complete
filter via agentpool), minijinja (minijinja backend), yaml.
pip install "jinjarope[cli]"
Quickstart
import jinjarope
env = jinjarope.Environment(loader=jinjarope.DictLoader({"hello.jinja": "Hello {{ name }}!"}))
print(env.render_template("hello.jinja", name="World")) # Hello World!
print(env.render_string("{{ 'Hello World' | slugify }}")) # hello_world
Features
jinjarope.Environment: drop-injinja2.Environmentsubclass with ~150 additional filters / tests / functions,render_string/render_file/render_template,with_globals(), selectable undefined behavior ("strict","lax", ...), and an entry-point (jinjarope.environment) to let other packages extend every environment.- Two template engines behind one protocol (
jinjarope.engine.TemplateEngine): Jinja2 (jinjarope.Environment, default) and minijinja (jinjarope.MiniJinjaEnvironment, extraminijinja), with the same filters, loaders and errors. Differences: Template engines. - Subclasses of all jinja2 loaders with
__eq__,__hash__,__repr__and__getitem__, plus fsspec-based and dict-based loaders. - JinjaFiles: TOML files declaring filters, tests, functions and environment config.
- A read-only fsspec filesystem exposing a loader's templates (for debugging).
- A
jinjaropeCLI to render (remote) templates:jinjarope -i template.jinja -j config.toml -o out.md(with thecliextra).
Templates are trusted code
A jinjarope.Environment is full-power by design, not a sandbox. Templates can import
modules (import_module), run shell commands (get_output_from_call), execute Python
(evaluate), and, with the default setup_loader() / get_loader() (fsspec_paths=True),
{% include %} any local file or URL ("/etc/hostname", "https://..."), outside the
loader's search path. Only render templates you would run as code. Pass
fsspec_paths=False to keep includes inside the configured loaders; for untrusted
templates, use jinja2.sandbox.SandboxedEnvironment instead.
FsSpecFileSystemLoader
Works like a FileSystemLoader, but on any fsspec-supported (remote) location.
The URL's path is the root (file:///templates, s3://bucket/prefix, or with the
dir:: prefix); paths escaping it (../) are not found.
import fsspec
import jinjarope
# protocol path
loader = jinjarope.FsSpecFileSystemLoader("dir::github://phil65:jinjarope@main/tests/testresources")
env = jinjarope.Environment(loader=loader)
env.get_template("testfile.jinja").render()
# protocol and storage options
loader = jinjarope.FsSpecFileSystemLoader("github", org="phil65", repo="jinjarope")
env = jinjarope.Environment(loader=loader)
env.get_template("README.md").render()
# fsspec filesystem
fs = fsspec.filesystem("github", org="phil65", repo="jinjarope")
loader = jinjarope.FsSpecFileSystemLoader(fs)
env = jinjarope.Environment(loader=loader)
env.get_template("README.md").render()
FsSpecProtocolPathLoader
Accepts complete fsspec protocol paths as template names.
loader = jinjarope.FsSpecProtocolPathLoader()
env = jinjarope.Environment(loader=loader)
env.get_template("github://phil65:jinjarope@main/tests/testresources/testfile.jinja").render()
NestedDictLoader
[example]
template = "{{ something }}"
import tomllib
with open("templates.toml", "rb") as toml_file:
content = tomllib.load(toml_file)
loader = jinjarope.NestedDictLoader(content)
env = jinjarope.Environment(loader=loader)
env.get_template("example/template").render(something="value")
Loader composition
loader = jinjarope.FileSystemLoader("templates/")
template = loader["path/to/template.jinja"] # jinja2.Template
source = loader.get_template_source("path/to/template.jinja")
# OR loaders to get a ChoiceLoader
choice_loader = jinjarope.FileSystemLoader("templates/") | jinjarope.PackageLoader("my_package")
# pathlib-style division creates a PrefixLoader
prefix_loader = "path_prefix" / jinjarope.FileSystemLoader("templates/")
Filters, tests and functions
See the documentation for the full list of built-in filters, tests and functions with examples.
Metadata
Release files for jinjarope 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jinjarope-1.3.0.tar.gz | 2.7 MB | With provenance | Details for jinjarope-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jinjarope-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for jinjarope-1.3.0-py3-none-any.whl |
Total release size: 5.4 MB
Release files / jinjarope-1.3.0.tar.gz
| Download URL | jinjarope-1.3.0.tar.gz |
|---|---|
| Size | 2.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5df7aa1131555dde543efac93e6f4955a01750c606a6cfe59a1d6a3957fed20f
|
|
BLAKE2b-256 checksum How to use checksums |
072c1520d1284b42d7cef0bbe2dd14cdb5be567d42701c0ff53b0d86bd7e97ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / jinjarope-1.3.0-py3-none-any.whl
| Download URL | jinjarope-1.3.0-py3-none-any.whl |
|---|---|
| Size | 2.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54afefaa5df687dbb13d2e8a482de7485857335b06ad6dd5ca4b756c5ebb7780
|
|
BLAKE2b-256 checksum How to use checksums |
c91afaa9fe34b30e8819e6e18d532e8114731cc1c598730e60d4a0617cb892da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for jinjarope 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for jinjarope-1.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.