This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
Templite
==============

A light-weight, fully functional, general purpose Python templating engine that fits in one single file.

I'm not the author, credits go to Thimo Kraemer and Tomer Filiba. You can get the original source here_.

I'm just packaging it and making it available on pypi and github to give it visibility.

(If the authors want the repository ownership, please contact me)

Usage example::

from templite import Templite

template = r"""

This template demonstrates the usage of Templite.

Within the defined delimiters we can write pure Python code:

${
def say_hello(name):
write('Hello %s!' % name)
}$

And now we call the function: ${ say_hello('World') }$

Escaped starting delimiter: $\{
${ write('Escaped ending delimiter: }\$') }$

Also block statements are possible:

${ if x > 10: }$
x is greater than 10
${ :elif x > 5: }$
x is greater than 5
${ :else: }$
x is not greater than 5
${ :end-if / only the starting colon is essential to close a block }$

${ for i in range(x): }$
loop index is ${ i }$
${ :end-for }$

${ # this is a python comment }$

Single variables and expressions starting with quotes are substituted
automatically:
Instead ${write(x)}$ you can write ${x}$ or ${'%s' % x}$ or ${"", x}$
Therefore standalone statements like break, continue or pass
must be enlosed by a semicolon: $\{continue;}\$

To include another template, just call "include":
${ include('template.txt') }$
"""

t = Templite(template)
print t.render(x=8)



"""


Which outputs ::


This template demonstrates the usage of Templite.

Within the defined delimiters we can write pure Python code:



And now we call the function: Hello World!

Escaped starting delimiter: ${
Escaped ending delimiter: }$

Also block statements are possible:


x is greater than 5



loop index is 0

loop index is 1

loop index is 2

loop index is 3

loop index is 4

loop index is 5

loop index is 6

loop index is 7




Single variables and expressions starting with quotes are substituted
automatically:
Instead 8 you can write 8 or 8 or 8
Therefore standalone statements like break, continue or pass
must be enlosed by a semicolon: ${continue;}$

To include another template, just call "include":
This is the content of template.txt
.. _here: http://www.joonis.de/en/code/templite
Release History

Release History

0.2.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
templite-0.2.1.tar.gz (11.0 kB) Copy SHA256 Checksum SHA256 Source Jan 10, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting