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.2.tar.gz
(6.3 kB
view details)
Built Distribution
File details
Details for the file tstring-0.1.2.tar.gz
.
File metadata
- Download URL: tstring-0.1.2.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f97eafddb37395c6643d15a5cd1efa6382726de2a7af85ca74257ba917be76b8 |
|
MD5 | 361b107351ace2be7a2bda41186b2c28 |
|
BLAKE2b-256 | fb2ad26bfeb727aebf47284a625f089b0c439abc8b033d7a6f0bbe6e491bb98d |
File details
Details for the file tstring-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: tstring-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dda745a2654a7b393d2c73b9fe1a96f873f65226d42b07067ffb517252a6145e |
|
MD5 | 06a86eca0d277d3fe9ca8cfae21f95e3 |
|
BLAKE2b-256 | c581ff08bc02422ea321d9a9f4dd464f1aeb5ae8c38445aae38cc6bf3e259dcc |