Skip to main content

Simple jinja-based texts and objects render

Project description

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)

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.5.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jonja-0.1.5-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file jonja-0.1.5.tar.gz.

File metadata

  • Download URL: jonja-0.1.5.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

Hashes for jonja-0.1.5.tar.gz
Algorithm Hash digest
SHA256 56c347a1d1286a69eab79f41aff6757be211e2f7603e5488e57853daef42be81
MD5 de9819ba40594ac92aa37cb6289306f7
BLAKE2b-256 c8a666d7098fbcef720685f07eaae223fb5fea8d16d55857b69abcb86ce52d48

See more details on using hashes here.

File details

Details for the file jonja-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: jonja-0.1.5-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

Hashes for jonja-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9aa3d5fd990805fd5d0ab3a36c3143cdda3694116bc780acc9685d2f627c9dce
MD5 dc26f9a94c91006c8f29f41e58d16d49
BLAKE2b-256 ee4d4e09baef6540f12c40b128a0177e2f96ca0d64cb0bcee1589add0ea51b71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page