Mustache v1.3 implementation with lambdas.
Project description
combustache
Mustache v1.3 implementation with lambdas.
Usable both in code and as CLI.
To render a mustache template use combustache.render
.
Processed templates are cached; to clear cache use combustache.cache_clear
.
Installation
From PyPI:
pip install combustache
From git:
pip install git+https://github.com/sakhezech/combustache
Usage
Typical usage in code
>>> import combustache
>>> template = 'Hello my name is {{>fancy_name}}!'
>>> partials = {'fancy_name': '-> {{name}} <-'}
>>> data = {'name': 'Anahit'}
>>> combustache.render(template, data, partials)
'Hello my name is -> Anahit <-!'
Typical usage as CLI
combustache ...
or python -m combustache ...
For more info use combustache -h
.
$ curl https://end.point/v1/api | combustache template.txt -o out.txt
$ cat out.txt
Hello world!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for combustache-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d32bb18b68798596735f302ee889c395989d0db64a82871688fa61781da7881 |
|
MD5 | 93b044d4646d43993a9dea98039fc1d4 |
|
BLAKE2b-256 | e22cb2450336860237e0b752c756dc3b523b76d8b37631cf9bfc9dc5053428ee |