Skip to main content

PyPI version PyPI - Python Version PyPI - License

foostache

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.

Example

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]

Command-Line

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

Module

import foostache

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

Metadata

Release files for foostache 1.3.0

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

Built distribution (wheel)

Table of built distributions (wheels) for foostache 1.3.0
File Interpreter ABI Platform
foostache-1.3.0-py3-none-any.whl Python 3 none any Details

Release files / foostache-1.3.0-py3-none-any.whl

Download URL foostache-1.3.0-py3-none-any.whl
Size 49.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
226bb08120f0301550384782ab0b9155d48c099303dffb0c29952b96e003c214
BLAKE2b-256 checksum
How to use checksums
eedc78824f86ce2ed7792fc2cccd7b33ae25d6df90df1f8b8f25424f92017d16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for foostache 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.

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.

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