Tempita is a very small, simple text templating language designed for text substitution, not as a full-fledged web templating engine. It's suitable for generating Python files, configuration files, or other text-based content when `string.Template` is insufficient, but a heavier solution like Jinja is overkill. The current version is 0.6.0, which is Python 3 only. The project is explicitly in maintenance mode, not actively developed for new features.
pip install tempitaVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates both the `Template` class for creating reusable template objects and the `sub` function for immediate string substitution. It also includes an example using Tempita's control flow (`for`, `if`) and inline Python blocks (`py:`).
Ensure your project is running on Python 3 before upgrading to tempita==0.6.0. If Python 2 compatibility is required, pin to an older version (e.g., `tempita<0.6.0`).
Only use templates from trusted sources. Do not render user-provided templates directly without sanitization or sandboxing, which Tempita does not provide inherently.
Evaluate if Tempita's minimalist feature set meets your project's needs. For complex web rendering or rich templating features, consider alternatives.
Add `from tempita import Template` at the top of your Python file.
Review the template content around the reported line number (X) and column (Y) in the error message for syntax mistakes.
Ensure your environment is running Python 3 for Tempita 0.6.0+. For older Tempita versions, explicitly encode/decode strings to handle Unicode consistently, usually to UTF-8.
No dependency data recorded yet.