jonja


Namejonja JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummarySimple jinja-based texts and objects render
upload_time2024-10-08 21:57:22
maintainerNone
docs_urlNone
authorlightmanLP
requires_python<4.0,>=3.10
licenseMIT
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": null,
    "name": "jonja",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "jinja, template, text",
    "author": "lightmanLP",
    "author_email": "liteman1000@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/da/c0/123016b5a8d4e4de25823f101d941def3be1b281c6f15baf0387a23c5f45/jonja-0.1.1.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.1",
    "project_urls": {
        "Github": "https://github.com/UT1C/jonja"
    },
    "split_keywords": [
        "jinja",
        " template",
        " text"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6866845bc736b09feb7709f1b3b5e989e444400fef8013f41ea0cacbdbac6dd3",
                "md5": "79f7bac7db00e28ee2fafc6e1e974dd5",
                "sha256": "cb1281ee8162f55f3cb9c1772015ebd19ac45da9822ee8397f510f85eee4b5c9"
            },
            "downloads": -1,
            "filename": "jonja-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "79f7bac7db00e28ee2fafc6e1e974dd5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 5821,
            "upload_time": "2024-10-08T21:57:21",
            "upload_time_iso_8601": "2024-10-08T21:57:21.195468Z",
            "url": "https://files.pythonhosted.org/packages/68/66/845bc736b09feb7709f1b3b5e989e444400fef8013f41ea0cacbdbac6dd3/jonja-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dac0123016b5a8d4e4de25823f101d941def3be1b281c6f15baf0387a23c5f45",
                "md5": "b52d16bb7be7a5cf6f2d60c6a1dac033",
                "sha256": "c99e766752698bc42aec6aa1d4f63663e63e05799c80c7deca0d7a6dee673c8b"
            },
            "downloads": -1,
            "filename": "jonja-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b52d16bb7be7a5cf6f2d60c6a1dac033",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 4630,
            "upload_time": "2024-10-08T21:57:22",
            "upload_time_iso_8601": "2024-10-08T21:57:22.964454Z",
            "url": "https://files.pythonhosted.org/packages/da/c0/123016b5a8d4e4de25823f101d941def3be1b281c6f15baf0387a23c5f45/jonja-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-08 21:57:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "UT1C",
    "github_project": "jonja",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "jonja"
}
        
Elapsed time: 0.48409s