Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A standardized Python templating language interface.
Python
Tag: 0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
cti
tests
.gitignore
README
distribute_setup.py
setup.cfg
setup.py

README

A common templating interface for Python, esp. web applications.

Simple usage:

    >>> from cti.core import Engines
    >>> render = Engines()
    >>> render.json("Hello world!")
    ('application/json', '"Hello world!"')
    
    >>> render.yaml(dict(name="world", statement="Hello!", test=['foo', 'bar', 'baz']))
    ('application/x-yaml',
     'name: world\nstatement: Hello!\ntest: [foo, bar, baz]\n')
    
    >>> render.sprintf(dict(name="world"), string="Hello %(name)s!")
    ('text/plain', 'Hello world!')

Framework usage:

    >>> from cti.core import Engines
    >>> render = Engines('genshi')
    >>> content_type, content = render('myapp.templates.foo')
    >>> content_type, content = render('myapp/templates/foo.html')
    >>> content_type, content = render('./templates/foo.html')
Something went wrong with that request. Please try again.