Skip to main content

Extremely plain and simple template engine for text files

Project description

Small template engine that replaces variables via dictionary values:

cat file.txt
"This is a {{variable}} in a {{string}}"

from coima import Template
t = Template({'variable':'word', 'string':'sentence'}, 'file.txt')

t.render()

u"This is a word in a sentence"

Syntax

No Python or code blocks are allowed, this is basically a dumb templating engine.

Variables should be a one word or 2 words together with an underscore. These are valid variables:

{{variable}} {{variable_one}}

Invalid variables are left ‘as is’ and left in the final rendered template.

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

coima-0.0.2.tar.gz (6.1 kB view details)

Uploaded Source

File details

Details for the file coima-0.0.2.tar.gz.

File metadata

  • Download URL: coima-0.0.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for coima-0.0.2.tar.gz
Algorithm Hash digest
SHA256 aae5fa1a5bd4ae07073779ea362851b6c1a703536b59b8ac0f75a9ed1f4e49ca
MD5 176436b6b5675192ea88ff4774d7aff0
BLAKE2b-256 6c2cb15baa38afb76d24fa3b370ac06046ed21e5e71139b2ffe81092d8c4e4f1

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