A minimalist template engine for Python3
The goal of Stencil is to provide just enough of a template engine in a single file.
Currently weighs in at 550 LoC (414 according to sloccount).
Quick Start
Make a directory for our templates:
$ mkdir tmplCreate a simple template:
Good morning, {{ name }}!Write a script to use it
import stencil loader = stencil.TemplateLoader(['tmpl/']) t = loader['index.html'] c = stencil.Context({'name': 'Ruprect'}) print t.render(c) # Should output "Good morning, Ruprect!"
Python support
As of stencil v4, there is a new expression syntax that is not backward compatible.
As of stencil v2.1, only Python 3.6+ is supported. As of stencil v2, only Python 3.4+ is supported.
Stencil 1.2.3 is the last stable Python 2.7 version.
See the documentation to see more details.
Release files for stencil-template 4.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stencil_template-4.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Release files / stencil_template-4.2.3-py3-none-any.whl
| Download URL | stencil_template-4.2.3-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b3810e11247105ec36ff6ae46f395cf1ae732c8f7259cdc524a9dbf3102fbbd
|
|
BLAKE2b-256 checksum How to use checksums |
4bb2e115b32949a882ad5cd979b3824168a832519add017cb9674b0b15642f76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|