Template Data Interface (TDI)
TDI (/ʹtedɪ/ ) is a
markup templating system written in python with (optional but
recommended) speedup code written in C.
Unlike most templating systems TDI does not invent its own language to
provide functionality . Instead you simply mark the nodes you want to
manipulate within the template document. The template is parsed and the
marked nodes are presented to your python code, where they can be
modified in any way you want.
TDI is currently available for python2 versions only (starting with
python 2.4). Python 3 is not supported yet. The following
alternative implementations are supported:
- PyPy (1.9, 2.0) (Python only)
- Jython (2.5, 2.7) (Python only)
TDI has proven its performance and stability in high load production
environments, which means, it works and it’s stable. There are still
some kinks to solve and a few missing minor features to add until TDI
reaches version 1.0. So, development wise it’s effectively a beta
release right now.
There are hashes (MD5, SHA1 and SHA256) of the download packages stored
in the digests file. In order to
check the integrity of the downloaded file, use a tool like md5sum (or
sha1sum, sha256sum accordingly), e.g.:
$ md5sum -c tdi-0.9.9.7.digests
In order to check the integrity of the digest file itself, you can check
the PGP signature of that file. The file is signed by André Malo, Key-ID
$ gpg --verify tdi-0.9.9.7.digests
gpg: Signature made Sun May 12 15:08:56 2013 CEST using DSA key ID 8103A37E
gpg: Good signature from "Andre Malo <email@example.com>"
gpg: aka "Andr\xe9\x20Malo <firstname.lastname@example.org>"
gpg: aka "Andre Malo <email@example.com>"
Get Informed About New Releases
If you want to get informed about new releases of the TDI, you may
use the subscription service provided by freecode.com.
Rationale, Advocacy, Key Features
Here is the short variant why you should consider reading on:
is pure, simple, fast
And here’s a bit more (for the long variant have a look at the
- Template and Logic are strictly separated. TDI is the bridge
between template and rendering logic.
- There is no templating language at all, just your markup language
(e.g. HTML) and python. (There’s a markup language for plain text
- TDI is non-intrusive - it blends in, both on template and
- TDI has a steep learning curve. It’s easy to learn and easy to
- Knowing about your programming language (Python) and knowing about
your template language (like HTML) is entirely sufficient.
- You can even use your usual tools to document and validate your code
(like pylint, epydoc or an HTML validator).
- TDI escapes your content automatically - you are safe by default.
- TDI comes as a stand-alone package. Don’t worry about dependencies.
- Use TDI for rapid development. It’s easy to parallelize the work on
layout and logic. You can even use mock-ups as templates.
- TDI runs with ludicrous speed.
- Pre-rendering the less dynamic parts makes it even faster.
- Semantically partition your code both on template and logic side using
overlays and scopes.
- Partial rendering is supported (useful for dynamic web sites).
- Process your templates during loading time with parser filters.
- TDI is unicode aware and automatically emits the desired encoding.
- TDI is designed to be highly customizable and extendable. Nearly every
component can be modified or replaced.
TDI is available under the terms and conditions of the “Apache License,
Version 2.0.” You’ll find the detailed licensing terms in the root
directory of the source distribution package or online at