Skip to main content

jinja2-fsloader star me

A Jinja2 template loader using PyFilesystem2.

build repo versions changelog format coverage grade license

About

This library allows you to use PyFilesystem2 as a backend to load templates into Jinja2. You can take advantage of the whole fs ecosystem, which already implements drivers for FTP, SSH, SMB, S3, WebDAV servers, ZIP and Tar archives, and many more!

Installation

Install with pip:

$ pip install --user -U jinja2-fsloader

Usage

from jinja2_fsloader import FSLoader
FSLoader(template_fs, encoding='utf-8', use_syspath=False)
template_fs

a FS instance or an FS URL where the templates are located.

encoding

the encoding of the template files (utf-8 by default).

use_syspath

set to True for the loader to return the real path or an URL to the template when available (False by default).

Examples

import jinja2
from jinja2_fsloader import FSLoader

# templates in a ZIP archive
env = jinja2.Environment(loader=FSLoader("zip:///path/to/my/templates.zip"))

# templates in a S3 bucket
env = jinja.Environment(loader=FSLoader("s3://mybucket"))

# templates in memory
mem = fs.open_fs('mem://')
mem.settext('template.j2', 'This template is {{adjective}}')
env = jinja.Environment(loader=FSLoader(mem))

See Also

The complete documentation of PyFilesystem2 can give you a better overview of all the features available in the library.

Metadata

Release files for jinja2-fsloader 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jinja2-fsloader 0.3.0
File Size Uploaded Provenance Actions
jinja2-fsloader-0.3.0.zip 13.1 kB Without provenance Details for jinja2-fsloader-0.3.0.zip

Built distribution (wheel)

Table of built distributions (wheels) for jinja2-fsloader 0.3.0
File Interpreter ABI Platform Actions
jinja2_fsloader-0.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for jinja2_fsloader-0.3.0-py2.py3-none-any.whl

Total release size: 20.3 kB

Release files / jinja2-fsloader-0.3.0.zip

Download URL jinja2-fsloader-0.3.0.zip
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d91a7c5244e2720a0be4afa289aa3dc76ac44b4071dfb81269593ce0cb99b4ee
BLAKE2b-256 checksum
How to use checksums
f0e08ef49112c525455eafa3f1e4671951f6f4c37068fb8cea40566947f73b71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.7

Release files / jinja2_fsloader-0.3.0-py2.py3-none-any.whl

Download URL jinja2_fsloader-0.3.0-py2.py3-none-any.whl
Size 7.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3182fc4c1bc8bfae8f7c78f4f9916b91a09b677dc3bcb6c2cfba7382cd30ee27
BLAKE2b-256 checksum
How to use checksums
3a1288943c21fd28bfdb0e1f12334a28b171e3ee3e51f3859fb162e1ef7c2700
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.7

Security for jinja2-fsloader 0.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page