Name | jonja JSON |
Version |
0.1.0
JSON |
| download |
home_page | |
Summary | Simple jinja-based texts and objects render |
upload_time | 2024-03-09 08:55:27 |
maintainer | |
docs_url | None |
author | lightmanLP |
requires_python | >=3.10,<4.0 |
license | MIT |
keywords |
jinja
template
text
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# jonja
[![PyPI version](https://badge.fury.io/py/jonja.svg)](https://badge.fury.io/py/jonja)
![PyPI downloads per mounth](https://img.shields.io/pypi/dm/jonja)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/UT1C/jonja)
Jinja-based texts and objects render.
## Installation
```
pip install jonja
```
## Usage
1. Make template
`hello.j2`
```j2
Hello, {{ username }}!
*#!#*
world:
$cls: "types:SimpleNamespace"
$kwargs: {name: earth, size: {{ world_size }} }
```
2. Make env
```py
from pathlib import Path
from jonja import JonjaEnv
env = JonjaEnv(Path.cwd() / "static" / "templates")
```
3. Render
```py
text, objs = await env.render("hello", username="mikk", world_size=10_000)
```
Raw data
{
"_id": null,
"home_page": "",
"name": "jonja",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "jinja,template,text",
"author": "lightmanLP",
"author_email": "liteman1000@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/1d/53/c2a9ae1cce14410592aa9e242e7a8c52c0fde765374d3fef1f818bf9ab1f/jonja-0.1.0.tar.gz",
"platform": null,
"description": "# jonja\n[![PyPI version](https://badge.fury.io/py/jonja.svg)](https://badge.fury.io/py/jonja)\n![PyPI downloads per mounth](https://img.shields.io/pypi/dm/jonja)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/UT1C/jonja)\n\nJinja-based texts and objects render.\n\n## Installation\n```\npip install jonja\n```\n\n## Usage\n1. Make template\n`hello.j2`\n```j2\nHello, {{ username }}!\n*#!#*\nworld:\n $cls: \"types:SimpleNamespace\"\n $kwargs: {name: earth, size: {{ world_size }} }\n```\n2. Make env\n```py\nfrom pathlib import Path\nfrom jonja import JonjaEnv\nenv = JonjaEnv(Path.cwd() / \"static\" / \"templates\")\n```\n3. Render\n```py\ntext, objs = await env.render(\"hello\", username=\"mikk\", world_size=10_000)\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simple jinja-based texts and objects render",
"version": "0.1.0",
"project_urls": {
"Github": "https://github.com/UT1C/jonja"
},
"split_keywords": [
"jinja",
"template",
"text"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "aceabe14b09cb148065c3a6322abcb2938d69d4497dc61b9e12836a8ea63aa2a",
"md5": "1e7adf24893fce9194ab4153cff78a54",
"sha256": "4bbd827e203c0815d7193485c296c32e111f7753023569b55439178c117ad071"
},
"downloads": -1,
"filename": "jonja-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1e7adf24893fce9194ab4153cff78a54",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 5816,
"upload_time": "2024-03-09T08:55:25",
"upload_time_iso_8601": "2024-03-09T08:55:25.488342Z",
"url": "https://files.pythonhosted.org/packages/ac/ea/be14b09cb148065c3a6322abcb2938d69d4497dc61b9e12836a8ea63aa2a/jonja-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1d53c2a9ae1cce14410592aa9e242e7a8c52c0fde765374d3fef1f818bf9ab1f",
"md5": "032705470f340c411f514825ef2c2a19",
"sha256": "c88f2738369502e280fb965ab341fbbc19df26868ccaac5fe066990cb93d3e29"
},
"downloads": -1,
"filename": "jonja-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "032705470f340c411f514825ef2c2a19",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 4625,
"upload_time": "2024-03-09T08:55:27",
"upload_time_iso_8601": "2024-03-09T08:55:27.238241Z",
"url": "https://files.pythonhosted.org/packages/1d/53/c2a9ae1cce14410592aa9e242e7a8c52c0fde765374d3fef1f818bf9ab1f/jonja-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-09 08:55:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "UT1C",
"github_project": "jonja",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "jonja"
}