Simple jinja-based texts and objects render
Project description
jonja
Jinja-based texts and objects render.
Installation
pip install jonja
Usage
- Make template
hello.j2
Hello, {{ username }}!
*#!#*
world:
$cls: "types:SimpleNamespace"
$kwargs: {name: earth, size: {{ world_size }} }
- Make env
from pathlib import Path
from jonja import JonjaEnv
env = JonjaEnv(Path.cwd() / "static" / "templates")
- Render
text, objs = await env.render("hello", username="mikk", world_size=10_000)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jonja-0.1.0.tar.gz
(4.6 kB
view hashes)
Built Distribution
jonja-0.1.0-py3-none-any.whl
(5.8 kB
view hashes)