Skip to main content

CI Maintenance PyPI version PyPI downloads Python versions

Chevron

Chevron is a modern Python implementation of the Mustache templating language. It is a maintained fork of the original chevron, with current Python support, pinned Mustache conformance fixtures, safe opt-in filesystem partials, explicit lambda protocols, and optional runtime-neutral async rendering.

Chevron requires Python 3.11 or later.

import chevron

chevron.render("Hello, {{name}}!", {"name": "Ada"})

Command line

Render a template file with optional JSON data and a trusted partial directory:

chevron greeting.mustache --data values.json --path partials

Run chevron --help for delimiters, partial extension, and version options. The CLI retains its historical current-directory partial lookup default; use --path to select the directory deliberately.

Library use

render() accepts template text, tokens, and ordinary file-like objects. Provide in-memory partials through partials_dict; filesystem lookup is disabled for library calls until partials_path is supplied.

chevron.render(
    "{{> greeting}}",
    {"name": "Ada"},
    partials_dict={"greeting": "Hello, {{name}}!"},
)

For untrusted templates, supply an explicit lambdas mapping, including lambdas={} when no callable tags are allowed. This restricts callable template extensions but is not a general template sandbox: keep secrets and rich objects out of template data. Filesystem partials reject absolute names, parent traversal, and resolved paths outside the configured directory.

Chevron is quiet by default. Use warn=True for recoverable diagnostics, or pass a standard-library logger for application-owned logging configuration.

Async rendering requires the optional anyio extra; applications using Trio also require the trio extra. For the complete synchronous and asynchronous API, lambda protocols, logging, resource ownership, and migration guidance, see the Chevron documentation.

Chevron retains a pinned copy of the Mustache specification fixtures, including lambda cases. See its attribution. If Chevron fails a Mustache case, please open an issue.

Development

The suite combines Chevron behavioural tests, pinned Mustache fixtures, and bounded property tests.

Metadata

Release files for chevron-ng 0.20.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chevron-ng 0.20.0
File Size Uploaded Provenance Actions
chevron_ng-0.20.0.tar.gz 29.8 kB Without provenance Details for chevron_ng-0.20.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chevron-ng 0.20.0
File Interpreter ABI Platform Actions
chevron_ng-0.20.0-py3-none-any.whl Python 3 none any Details for chevron_ng-0.20.0-py3-none-any.whl

Total release size: 61.5 kB

Release files / chevron_ng-0.20.0.tar.gz

Download URL chevron_ng-0.20.0.tar.gz
Size 29.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a76a66d02bb34c59172e022a3790acc710f162d1824782e0871c790da5acfa4a
BLAKE2b-256 checksum
How to use checksums
06ca3d5798e0f9294e00745103f585a7c36deaaca69de1347ae701ff6dc8d571
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / chevron_ng-0.20.0-py3-none-any.whl

Download URL chevron_ng-0.20.0-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bcd22086248270df47112d74ac31d008e7071a18db8147e52992be0a5a62c1a
BLAKE2b-256 checksum
How to use checksums
0d6a2ed859aada7824bd8f3e553a9e09c156c0d36464a2db68bab1e62405be9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for chevron-ng 0.20.0

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