Yatla: typed templating

PyPI - License PyPI - Python Version PyPI - Wheel

Yatla is an simple, statically-typed templating language for Python.


Statically typed templates:

>>> template = yatla.parse("Hello, {{ name }}!")
>>> template.slots
[Slot(name='name', type=<SlotType.Any: 3>)]
>>> template.fill({"name": "world"})
'Hello, world!'
>>> template = yatla.parse("{{ factor }} * 2 = {{ factor * 2 }}")
>>> template.slots
[Slot(name='factor', type=<SlotType.Num: 2>)]
>>> template.fill({"factor": 3})
'3 * 2 = 6'

You can install the library directly from PyPI:

$ pip install yatla

User guide