Delayed fstring-like string templates in python.
Project description
tstring
Curly-brace string templates in Python.
pip install tstring
Usage
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:
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"
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tstring-0.1.1.tar.gz
(5.9 kB
view hashes)