--- id: documenttemplate version: "5.3" license: ZPL-2.1 license_treatment: unclear maintenance: active --- # DocumentTemplate — Document Templating Markup Language (DTML) License: unclear · Maintenance: active · Downloads: 136.8K/mo ## What it is and what it does DocumentTemplate is a legacy templating system from the Zope framework that processes DTML (Document Templating Markup Language)—a custom SGML-based markup for embedding dynamic content in HTML and SQL templates. It provides variable substitution, conditional blocks, loops, and other programmatic features through custom tags like ``, ``, and ``. The package is now primarily maintained for backward compatibility with existing Zope applications. Modern Zope environments have largely moved to TAL (Template Attribute Language) and page templates for new development. It depends on Zope security and object-access infrastructure (AccessControl, Acquisition, RestrictedPython) and integrates with zope.sequencesort for sorting operations. The implementation is pure Python as of version 3.0, with no compiled dependencies. Use it for: - Maintaining or extending legacy Zope applications that use DTML templates for dynamic page generation. - Rendering HTML or SQL templates with variable substitution and conditional logic in Zope-based systems. - Processing DTML documents that require restricted execution contexts for security-sensitive applications. - Migrating or refactoring older Zope codebases while preserving existing DTML template functionality. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. DocumentTemplate implements the Document Templating Markup Language (DTML), a legacy template system using custom SGML tags for variable replacement, conditional logic, and loops in Zope environments. Yes, but only if you are maintaining or extending an existing Zope application that uses DTML. Do not install for new projects—use modern templating systems instead. The package is actively maintained, has no known vulnerabilities, and installs with low friction. License treatment is unclear; verify ZPL-2.1 compliance for your use case before deployment. ## Install pip install documenttemplate uv add documenttemplate poetry add documenttemplate ## Installing DocumentTemplate Before you install: Low friction installation with a pure-Python implementation and no compiled dependencies. Actively maintained with recent releases; last commit on 2026-02-25. Requires Python 3.10 or later. License in practice: Licensed under ZPL-2.1 (Zope Public License 2.1), though license treatment is marked unclear in the metadata. Verify compliance requirements before use in proprietary or commercial projects. Quickstart: pip install DocumentTemplate from DocumentTemplate import HTML template = HTML('') result = template(name='Hello') Requires Python 3.10 or later. Designed primarily for Zope environments; standalone use outside Zope may require additional setup for full functionality. Verify before relying: - Whether DTML templates can be safely used with untrusted input given the RestrictedPython dependency and its security model. - Current adoption rate and whether new projects should use DTML or migrate to modern Zope templating (TAL/page templates). - Specific performance characteristics compared to modern template engines. ## Package facts - License: ZPL-2.1 (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 136.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags DTML template engine, zope document templating, SGML markup templating, legacy zope templates, dtml variable replacement, zope conditional templating, html template markup language, legacy-zope, dtml-templates, restricted-execution [View on SkillFed](https://skillfed.io/packages/documenttemplate) · [View on PyPI](https://pypi.org/project/documenttemplate/)