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.1.tar.gz
(4.6 kB
view details)
Built Distribution
jonja-0.1.1-py3-none-any.whl
(5.8 kB
view details)
File details
Details for the file jonja-0.1.1.tar.gz
.
File metadata
- Download URL: jonja-0.1.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c99e766752698bc42aec6aa1d4f63663e63e05799c80c7deca0d7a6dee673c8b |
|
MD5 | b52d16bb7be7a5cf6f2d60c6a1dac033 |
|
BLAKE2b-256 | dac0123016b5a8d4e4de25823f101d941def3be1b281c6f15baf0387a23c5f45 |
File details
Details for the file jonja-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: jonja-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb1281ee8162f55f3cb9c1772015ebd19ac45da9822ee8397f510f85eee4b5c9 |
|
MD5 | 79f7bac7db00e28ee2fafc6e1e974dd5 |
|
BLAKE2b-256 | 6866845bc736b09feb7709f1b3b5e989e444400fef8013f41ea0cacbdbac6dd3 |