templo


Nametemplo JSON
Version 0.0.9 PyPI version JSON
download
home_page
SummaryGeneric template language.
upload_time2022-05-15 18:49:45
maintainer
docs_urlNone
author
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Templo

A generic template language.

## Installation

Run the following command to install:

```python
pip install templo
```

## Usage

```python
from templo import template

# Generate a render funtion
render = template("foo {{ 2 + 3 }} bar")
# returns 'foo 5 bar'
render()

# Generate a render function and pass a dictionary
d = {"name": "Diana"}
render = template("Hello, {{ name or 'World' }}!")
# returns 'Hello, World!'
render()
# returns 'Hello, Diana!'
render(d)

# Generate final text
# returns 'Hello, simple world!'
template("Hello,{% if answer == 42 %} simple {% else %} cruel {% endif %}world!", {'answer': 42})
# returns 'Hello, cruel world!'
template("Hello,{% if answer == 42 %} simple {% else %} cruel {% endif %}world!", {'answer': 73})
```



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "templo",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/37/27/6db0f5230dcea13a39b14bd1e4ff3e989d847bb277a573bb6cfa2b485b4c/templo-0.0.9.tar.gz",
    "platform": null,
    "description": "# Templo\n\nA generic template language.\n\n## Installation\n\nRun the following command to install:\n\n```python\npip install templo\n```\n\n## Usage\n\n```python\nfrom templo import template\n\n# Generate a render funtion\nrender = template(\"foo {{ 2 + 3 }} bar\")\n# returns 'foo 5 bar'\nrender()\n\n# Generate a render function and pass a dictionary\nd = {\"name\": \"Diana\"}\nrender = template(\"Hello, {{ name or 'World' }}!\")\n# returns 'Hello, World!'\nrender()\n# returns 'Hello, Diana!'\nrender(d)\n\n# Generate final text\n# returns 'Hello, simple world!'\ntemplate(\"Hello,{% if answer == 42 %} simple {% else %} cruel {% endif %}world!\", {'answer': 42})\n# returns 'Hello, cruel world!'\ntemplate(\"Hello,{% if answer == 42 %} simple {% else %} cruel {% endif %}world!\", {'answer': 73})\n```\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Generic template language.",
    "version": "0.0.9",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "df1dc070b3dc3e84053ce97f71bd313d",
                "sha256": "77aee868b388e2f5ff085ca4ef192a37e3764235b27aecfd708cc9c93e9aaf61"
            },
            "downloads": -1,
            "filename": "templo-0.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "df1dc070b3dc3e84053ce97f71bd313d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 26934,
            "upload_time": "2022-05-15T18:49:43",
            "upload_time_iso_8601": "2022-05-15T18:49:43.873238Z",
            "url": "https://files.pythonhosted.org/packages/3e/2c/5b2d3ee95af0c9397dc0c597fe44f15f2ff317b803aa8dfd3b10093ea98f/templo-0.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "af4ef0371df0c2c4fca123bdd35e7ac9",
                "sha256": "058c094c8e1b8945ad3aa5c98365096f16b0a2818bb906455c344483495be07a"
            },
            "downloads": -1,
            "filename": "templo-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "af4ef0371df0c2c4fca123bdd35e7ac9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 22023,
            "upload_time": "2022-05-15T18:49:45",
            "upload_time_iso_8601": "2022-05-15T18:49:45.764559Z",
            "url": "https://files.pythonhosted.org/packages/37/27/6db0f5230dcea13a39b14bd1e4ff3e989d847bb277a573bb6cfa2b485b4c/templo-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-05-15 18:49:45",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "templo"
}
        
Elapsed time: 0.38946s