Metadata-Version: 2.1
Name: foostache
Version: 1.2.1
Summary: The foostache template engine.
Home-page: https://github.com/ldgabbay/foostache-python/
Author: Lynn Gabbay
Author-email: gabbay@gmail.com
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4
Description-Content-Type: text/markdown
Requires-Dist: future (~=0.17.1)
Requires-Dist: ujson (~=1.35)
Requires-Dist: antlr4-python2-runtime (~=4.7.2)

[![PyPI version](https://badge.fury.io/py/foostache.svg)](https://badge.fury.io/py/foostache)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/foostache.svg)
![PyPI - License](https://img.shields.io/pypi/l/foostache.svg)

# 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](https://github.com/ldgabbay/foostache).

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:
```text
{{: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:
```json
{ "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:
```text
[ 4.00,  3.51, 96.80]
```


## Command-Line

```text
foostache template-file context-json-file
```

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


## Module

```python
import foostache

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


