Metadata-Version: 2.1
Name: tstring
Version: 0.1.0
Summary: Delayed fstring-like string templates in python.
Author-email: Maxwell Levin <24307537+maxwelllevin@users.noreply.github.com>
License: BSD 3-Clause License
Keywords: string,template
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# tstring

[![main](https://github.com/maxwelllevin/tstring/actions/workflows/pytest.yml/badge.svg)](https://github.com/maxwelllevin/tstring/actions/workflows/pytest.yml)
[![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)

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"
```
