Skip to main content

simple string template library

Project description

string_templates

Library to create string templates in python and execute them.

Single line

render("Hello, $name", name="Tom")
# "Hello, Tom"

Multiline strings

render("""
Hello
$name
""", name="Tom")
# '\nHello\nTom\n'

# no newline at start and end
render("""\
Hello
$name\
""", name="Tom")
# 'Hello\nTom'

template classes

@template
class Test:
    name: str
    _template = """Hello, $name"""
str(Test("Tom"))
# 'Hello, Tom'

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

string_templates-0.1.1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

string_templates-0.1.1-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file string_templates-0.1.1.tar.gz.

File metadata

  • Download URL: string_templates-0.1.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.1 Linux/5.10.16-arch1-1

File hashes

Hashes for string_templates-0.1.1.tar.gz
Algorithm Hash digest
SHA256 872fe4285c1d53770f283ee51144fd84da426e1a7d9813d2361825fb4086ed1b
MD5 7d81f40320e97d731759fb07ce433296
BLAKE2b-256 89e30951db5c2ac8c73347abe571fc787be62e582ef489b1a073d7a1629a5dd6

See more details on using hashes here.

File details

Details for the file string_templates-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: string_templates-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.1 Linux/5.10.16-arch1-1

File hashes

Hashes for string_templates-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 41762c0b62b61f786320e656f5780e865cd9fe1d81be7cc495a5a4a740b8d3fa
MD5 9931d3edfb4b07fe7a6985857bde02ff
BLAKE2b-256 0e7d6960dc15e666559e65b3e98f44c12a1ec0191fc7971e7ce6b3d7df830cef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page