Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

The foostache template engine.

Project description

PyPI version PyPI - Python Version PyPI - License


foostache is a language and environment independent template engine.

Unlike alternatives such as Jinja2 and mustache, foostache can theoretically be implemented in any programming language for any runtime environment. The complete language specification can be found here.

This package provides a command-line utility and modules for Python 2 and 3.


A template is marked-up unicode that might look like this:

{{:iterate my_array 1::2}}{{. %5.2f}}{{:before}}[{{:between}}, {{:after}}]{{:end}}

The template can be rendered given a context. The context is usually specified with a JSON value, such as:

{ "my_array": [2.6, 4, 18, 3.51, 42, 96.8] }

When the above context is applied to the above template, the following output is generated:

[ 4.00,  3.51, 96.80]


foostache template-file context-json-file
python -m foostache template-file context-json-file


import foostache

template = foostache.Template("{{:iterate .}}{{.}}{{:end}}")
assert template.render(["a", "b", "c"]) == "abc"

Project details

Download files

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

Files for foostache, version 1.2.1
Filename, size File type Python version Upload date Hashes
Filename, size foostache-1.2.1-py2-none-any.whl (49.5 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size foostache-1.2.1-py3-none-any.whl (50.1 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page