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)

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.0.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

jonja-0.1.0-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

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