Templates, Evolved
AST-native. Free-threading ready. Zero regex.
Kida is a pure-Python template engine designed for Python 3.14t+. It compiles templates directly to Python AST—no string manipulation, no regex, no security vulnerabilities.
from kida import Environment
env = Environment()
template = env.from_string("Hello, {{ name }}!")
print(template.render(name="World"))
# Output: Hello, World!
What's good about it
Compiles templates toast.Moduleobjects directly. No string concatenation, no regex parsing, no code generation vulnerabilities.
Built for Python 3.14t (PEP 703). Renders templates concurrently without the GIL. Declares_Py_mod_gil = 0.
Unified{% end %} for all blocks. Pattern matching with {% match %}. Pipelines with |>. Built-in caching.
Pure Python with no runtime dependencies. Includes nativeMarkupclass—no markupsafe required.
Performance
StringBuilder rendering for O(n) concatenation:
# Kida: O(n) StringBuilder
_out.append(...)
return "".join(_out)
| Template Size | Time |
|---|---|
| Small (10 vars) | ~0.3ms |
| Medium (100 vars) | ~2ms |
| Large (1000 vars) | ~15ms |
Zero Dependencies
Kida is pure Python with no runtime dependencies:
[project]
dependencies = [] # Zero!
Includes a native Markupclass for safe HTML handling—no markupsafe required.
The Bengal Ecosystem
A structured reactive stack — every layer written in pure Python for 3.14t free-threading.
| ᓚᘏᗢ | Bengal | Static site generator | Docs |
| ∿∿ | Purr | Content runtime | — |
| ⌁⌁ | Chirp | Web framework | Docs |
| =^..^= | Pounce | ASGI server | Docs |
| )彡 | Kida | Template engine ← You are here | Docs |
| ฅᨐฅ | Patitas | Markdown parser | Docs |
| ⌾⌾⌾ | Rosettes | Syntax highlighter | Docs |
Python-native. Free-threading ready. No npm required.