Skip to main content

jonja

PyPI version PyPI downloads per mounth GitHub code size in bytes

Jinja-based texts and objects render.

Installation

pip install jonja

Usage

  1. Make template hello.j2
Hello, {{ username }}!
*#!#*
world:
  $cls: "types:SimpleNamespace"
  $kwargs: {name: earth, size: {{ world_size }} }
  1. Make env
from pathlib import Path
from jonja import JonjaEnv
env = JonjaEnv(Path.cwd() / "static" / "templates")
  1. 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)

Metadata

Release files for jonja 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jonja 0.1.6
File Size Uploaded
jonja-0.1.6.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jonja 0.1.6
File Interpreter ABI Platform
jonja-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / jonja-0.1.6.tar.gz

Download URL jonja-0.1.6.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0e3c980e9e7e24bf96734b92627ff432017e15418c287c8f8ada44d32152682f
BLAKE2b-256 checksum
How to use checksums
2c49c4dbbc1b075825c5f68fbc9c3d1aa3371d4d4dc54e5d871bcb0f8c25339e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.10.5 Windows/10

Release files / jonja-0.1.6-py3-none-any.whl

Download URL jonja-0.1.6-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4a91a30535a5293f9425bc42e4d420613722161774ff6efd588f8a309c8275f
BLAKE2b-256 checksum
How to use checksums
e8b8c42036d87c73e8ada42a9fbbeeadd8b55b9e81c4fd4837c9d5044bf1d36c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.10.5 Windows/10

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page