Skip to main content

stencil

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

  1. Make a directory for our templates:

    $ mkdir tmpl
  2. Create a simple template:

    Good morning, {{ name }}!
  3. 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.

Metadata

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)

Table of built distributions (wheels) for stencil-template 4.2.3
File Interpreter ABI Platform Actions
stencil_template-4.2.3-py3-none-any.whl Python 3 none any Details for stencil_template-4.2.3-py3-none-any.whl

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

Security for stencil-template 4.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page