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)
TODO
- make deepcopy of cached generated objects (maybe controlled by option on both env and render side)
Project details
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.6.tar.gz
(4.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
jonja-0.1.6-py3-none-any.whl
(5.9 kB
view details)
File details
Details for the file jonja-0.1.6.tar.gz.
File metadata
- Download URL: jonja-0.1.6.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.5 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e3c980e9e7e24bf96734b92627ff432017e15418c287c8f8ada44d32152682f
|
|
| MD5 |
bc7d64a333ee568f5f5e68c125929c6b
|
|
| BLAKE2b-256 |
2c49c4dbbc1b075825c5f68fbc9c3d1aa3371d4d4dc54e5d871bcb0f8c25339e
|
File details
Details for the file jonja-0.1.6-py3-none-any.whl.
File metadata
- Download URL: jonja-0.1.6-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.5 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4a91a30535a5293f9425bc42e4d420613722161774ff6efd588f8a309c8275f
|
|
| MD5 |
1e9c4756a99f7bd1bfbad884e563f088
|
|
| BLAKE2b-256 |
e8b8c42036d87c73e8ada42a9fbbeeadd8b55b9e81c4fd4837c9d5044bf1d36c
|