tstring


Nametstring JSON
Version 0.1.2 PyPI version JSON
download
home_page
SummaryDelayed fstring-like string templates in python.
upload_time2022-12-27 17:31:04
maintainer
docs_urlNone
author
requires_python>=3.7
licenseBSD 3-Clause License
keywords string template
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tstring

[![main](https://github.com/maxwelllevin/tstring/actions/workflows/pytest.yml/badge.svg)](https://github.com/maxwelllevin/tstring/actions/workflows/pytest.yml)
[![codecov](https://codecov.io/github/maxwelllevin/tstring/branch/main/graph/badge.svg?token=W6D5FN6AUA)](https://codecov.io/github/maxwelllevin/tstring)
[![build](https://github.com/maxwelllevin/tstring/actions/workflows/pypi.yml/badge.svg)](https://github.com/maxwelllevin/tstring/actions/workflows/pypi.yml)
![PyPI](https://img.shields.io/pypi/v/tstring)
![PyPI - Downloads](https://img.shields.io/pypi/dm/tstring)

Curly-brace string templates in Python.

```shell
pip install tstring
```

## Usage

```python
from tstring import Template

template = Template("{a}.{b}.{c}")
print(template.substitute(a="d", b="e", c="f"))
>>> "d.e.f"
```

Support for optional variable substitutions is also included:

```python
template = Template("{a}.{b}[.{c}]")
print(template.substitute(a="d", b="e", c="f"))
>>> "d.e.f"
print(template.substitute(a="d", b="e"))
>>> "d.e"
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "tstring",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "string,template",
    "author": "",
    "author_email": "Maxwell Levin <24307537+maxwelllevin@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/fb/2a/d26bfeb727aebf47284a625f089b0c439abc8b033d7a6f0bbe6e491bb98d/tstring-0.1.2.tar.gz",
    "platform": null,
    "description": "# tstring\n\n[![main](https://github.com/maxwelllevin/tstring/actions/workflows/pytest.yml/badge.svg)](https://github.com/maxwelllevin/tstring/actions/workflows/pytest.yml)\n[![codecov](https://codecov.io/github/maxwelllevin/tstring/branch/main/graph/badge.svg?token=W6D5FN6AUA)](https://codecov.io/github/maxwelllevin/tstring)\n[![build](https://github.com/maxwelllevin/tstring/actions/workflows/pypi.yml/badge.svg)](https://github.com/maxwelllevin/tstring/actions/workflows/pypi.yml)\n![PyPI](https://img.shields.io/pypi/v/tstring)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/tstring)\n\nCurly-brace string templates in Python.\n\n```shell\npip install tstring\n```\n\n## Usage\n\n```python\nfrom tstring import Template\n\ntemplate = Template(\"{a}.{b}.{c}\")\nprint(template.substitute(a=\"d\", b=\"e\", c=\"f\"))\n>>> \"d.e.f\"\n```\n\nSupport for optional variable substitutions is also included:\n\n```python\ntemplate = Template(\"{a}.{b}[.{c}]\")\nprint(template.substitute(a=\"d\", b=\"e\", c=\"f\"))\n>>> \"d.e.f\"\nprint(template.substitute(a=\"d\", b=\"e\"))\n>>> \"d.e\"\n```\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License",
    "summary": "Delayed fstring-like string templates in python.",
    "version": "0.1.2",
    "split_keywords": [
        "string",
        "template"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "06a86eca0d277d3fe9ca8cfae21f95e3",
                "sha256": "dda745a2654a7b393d2c73b9fe1a96f873f65226d42b07067ffb517252a6145e"
            },
            "downloads": -1,
            "filename": "tstring-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "06a86eca0d277d3fe9ca8cfae21f95e3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 4935,
            "upload_time": "2022-12-27T17:31:03",
            "upload_time_iso_8601": "2022-12-27T17:31:03.918794Z",
            "url": "https://files.pythonhosted.org/packages/c5/81/ff08bc02422ea321d9a9f4dd464f1aeb5ae8c38445aae38cc6bf3e259dcc/tstring-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "361b107351ace2be7a2bda41186b2c28",
                "sha256": "f97eafddb37395c6643d15a5cd1efa6382726de2a7af85ca74257ba917be76b8"
            },
            "downloads": -1,
            "filename": "tstring-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "361b107351ace2be7a2bda41186b2c28",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6258,
            "upload_time": "2022-12-27T17:31:04",
            "upload_time_iso_8601": "2022-12-27T17:31:04.898488Z",
            "url": "https://files.pythonhosted.org/packages/fb/2a/d26bfeb727aebf47284a625f089b0c439abc8b033d7a6f0bbe6e491bb98d/tstring-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-27 17:31:04",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "tstring"
}
        
Elapsed time: 0.27215s