Skip to main content

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.

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
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

Release history Release notifications | RSS feed

This release

4.2.3 This release

1 release file

4.2.2

1 release file

4.2.1

1 release file

4.2.0

1 release file

4.1.1

1 release file

4.1.0

1 release file

4.0.2

1 release file

4.0.1

1 release file

4.0.0

1 release file

3.0.3

1 release file

3.0.2

1 release file

3.0.1

1 release file

3.0.0

1 release file

2.1.0

1 release file

2.0.0

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.1

1 release file

1.0.0

1 release file

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