skillfed

pystache

Mustache for Python

pystache v0.6.8 4.2M downloads/30d#2,366 on PyPI19
Permissive license Copyright (C) 2012 Chris Jerdonek. All rights reserved. Copyright (c) 2009 Chris Wanstrath Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated… (full text in the JSON record) AGING released

What it is and what it does

Pystache is a Python implementation of Mustache, a framework-agnostic templating language designed to enforce separation of logic from presentation. It renders templates by interpolating values from Python dictionaries or objects into template strings, supporting sections, conditionals, and iteration through a simple, readable syntax. The package passes the full Mustache specification (version 1.1.3) and handles both simple string rendering and more complex view-based templates through its Renderer class.

The package is designed for scenarios where you want to keep templates free of application logic—Mustache makes it impossible to embed conditional or looping code in templates themselves. It supports Unicode internally and provides configurable encoding handling for file and string inputs. Pystache works across Linux, macOS, and Windows, with tested support for Python 3.8 through 3.13.

Use it for:

  • Render email templates or HTML documents with variable substitution from Python data structures.
  • Generate configuration files or code from templates without embedding logic in the template itself.
  • Build view classes that provide data to templates while keeping presentation logic separate from business logic.
  • Pre-parse templates once and render them multiple times with different context data.
  • Command-line template rendering when JSON or YAML context files are available.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Pystache renders Mustache templates—a logic-free templating system that separates presentation from application logic—using Python dictionaries and objects as context.

Yes, if you need a simple, logic-free templating system. Pystache is stable, permissively licensed, and has no known vulnerabilities. The aging maintenance status (514 days since last release) is not a blocker for a mature, spec-compliant library, but consider it if you need active development or frequent updates. Low install friction and broad Python version support make it a practical choice for projects prioritizing template simplicity over feature richness.

Install

pystache on PyPI

pip

pip install pystache

uv

uv add pystache

poetry

poetry add pystache

Installing pystache

Before you install

Low install friction with a single runtime dependency (importlib-metadata). Maintenance status is aging—last release was 514 days ago—but the repository remains active and the package is marked Production/Stable. Tested across Python 3.8 through 3.13.

License in practice

MIT license (permissive). You can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions, provided you include the original copyright notice.

Quickstart

pip install pystache

import pystache
print(pystache.render('Hi {{person}}!', {'person': 'Mom'}))
# Output: Hi Mom!

Requires Python 3.8 or later.

Verify before relying

  • Whether the aging maintenance status (514 days since last release) affects practical usability for new projects.
  • Performance characteristics compared to other Python templating engines for high-volume rendering.

Package facts

License Copyright (C) 2012 Chris Jerdonek. All rights reserved. Copyright (c) 2009 Chris Wanstrath Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — importlib-metadata
Maintenance aging — 514 days since the last release
Last repo commit
First released
Downloads 4,179,011/month — #2,366 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pystache-0.6.8-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries

Tags

mustache template rendering pythonlogic-free templating systempython template enginemustache implementationtemplate rendering with contextstring interpolation templatesview-based template rendering
templatingmustachelogic-free

More Libraries packages