Metadata-Version: 2.1
Name: templo
Version: 0.0.9
Summary: Generic template language.
Home-page: UNKNOWN
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE.txt

# Templo

A generic template language.

## Installation

Run the following command to install:

```python
pip install templo
```

## Usage

```python
from templo import template

# Generate a render funtion
render = template("foo {{ 2 + 3 }} bar")
# returns 'foo 5 bar'
render()

# Generate a render function and pass a dictionary
d = {"name": "Diana"}
render = template("Hello, {{ name or 'World' }}!")
# returns 'Hello, World!'
render()
# returns 'Hello, Diana!'
render(d)

# Generate final text
# returns 'Hello, simple world!'
template("Hello,{% if answer == 42 %} simple {% else %} cruel {% endif %}world!", {'answer': 42})
# returns 'Hello, cruel world!'
template("Hello,{% if answer == 42 %} simple {% else %} cruel {% endif %}world!", {'answer': 73})
```


