zope.tal provides an implementation of the Zope Template Application Language (TAL), a powerful and secure server-side templating system primarily used within the Zope framework but usable standalone. It enforces strict separation of presentation logic from application logic. The current stable version is 6.0, with releases typically tied to Python version support updates and Zope ecosystem advancements.
pip install zope.talVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a TAL template, create a Python object to serve as the template context, and render the template using `TALTemplate`.
Ensure your project uses Python 3.9 or newer. Upgrade your Python environment if necessary.
Upgrade `zope.interface` in your environment: `pip install 'zope.interface>=6.0'`.
Always ensure your TAL templates are valid XML/HTML. Use an HTML linter or validator if you encounter parsing issues.
Carefully verify that all variables and paths referenced in your TAL template exist in the provided context object. Use `tal:condition` or `tal:default` to handle potentially missing values gracefully.