Skip to main content

A Jinja2 template loader using PyFilesystem2

Project description

A Jinja2 template loader using PyFilesystem2.

build repo versions format coverage grade license


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!


Install with pip:

$ pip install --user -U jinja2-fsloader


from jinja2_fsloader import FSLoader
FSLoader(template_fs, encoding='utf-8', use_syspath=False)
a FS instance or an FS URL where the templates are located.
the encoding of the template files (utf-8 by default).
set to True for the loader to return the real path or an URL to the template when available (False by default).


import jinja2
from jinja2_fsloader import FSLoader

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

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

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
jinja2_fsloader-0.1.0-py2.py3-none-any.whl (8.4 kB) Copy SHA256 hash SHA256 Wheel py2.py3 (10.1 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page