Pekin is a simple templating engine for Python.
Pekin is designed for simplicity, security, and compatibility.
Unlike other templating engines, Pekin barely uses regex, which means fewer errors. It has no package requirements.
Pekin is extremely lightweight — it only weighs 9 kilobytes.
- Filters and parameters
- Escaping
- Loops
- Conditionals
- Executable Python
- HTML escaping
- Helpers (extensions)
- Partials
- Comments
- Easier template syntax
- Customizable template security
You need to install Git CMD to download Pekin for Python.
Go to your Git CMD and type:
git clone "https://github.com/cardinal9999/Pekin"
cd Pekin
py
The Pekin Docs page shows you how to code with Pekin in Python. It shows you all of the features in the Pekin templating engine.
[!-- Comments start with '!--' and end with '--'. --]
[~Escaping brackets~]
[variables_example]
[!-- If statement --]
[if 2 + 2 == 4 | var]
[!-- Loop --]
[each *vars | it + 3]
Length: [length | var]
HTML Escape: [htmlescape | var]
import pekin
template = """
your template here
"""
a = pekin.Duck(template)
rendered = a.render(parameters = "add your variables here")
Post an issue or pull request to help improve Pekin.