Fancy Pythonic String Builder.
Project description
Fancy Pythonic String Builder
- Free software: Apache Software License 2.0
Features
- Builds strings in a pythonic way.
- We're using the
with
statement to build substrings. - Python code can be interleaved with the string building.
Useful for generating code.
Example
from buildstr import Builder
b = Builder("A")
b << "B"
with b(surround=("{ ", " }"), separator="; ") as b1:
b1 << ["a", "b", "c"]
assert b.build() == "A B { a; b; c }"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
buildstr-0.1.0.tar.gz
(3.5 kB
view hashes)