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 API reference.
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.17.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chevron_ng-0.17.0.tar.gz | 25.3 kB | Without provenance | Details for chevron_ng-0.17.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chevron_ng-0.17.0-py3-none-any.whl | Python 3 | none | any | Details for chevron_ng-0.17.0-py3-none-any.whl |
Total release size: 52.7 kB
Release files / chevron_ng-0.17.0.tar.gz
| Download URL | chevron_ng-0.17.0.tar.gz |
|---|---|
| Size | 25.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dec680560c5e2c5bce826e0ec464b44d5e354f005269c7824c1ec98a6d9f0e45
|
|
BLAKE2b-256 checksum How to use checksums |
9c3f3b221734f9686ad248c07bfac54640d8f6a160070551bf54520581ce3a9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","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.17.0-py3-none-any.whl
| Download URL | chevron_ng-0.17.0-py3-none-any.whl |
|---|---|
| Size | 27.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f79c67a120d7aace4c0ffc2bbf85eb3dbe4ad4dbe4468e402efbccc0a800fd82
|
|
BLAKE2b-256 checksum How to use checksums |
3aacaa90c13b578c8aad612d7aa10d24ba0fbd10db275f007f1d086f115fba87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","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.17.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.