Chevron is a lightweight, pure-Python implementation of the Mustache templating language. It provides a simple API for rendering templates using dictionaries or objects as data contexts. It adheres closely to the Mustache specification. The current version is 0.14.0, and it generally follows an as-needed release cadence for bug fixes and minor improvements, with long periods of stability.
pip install chevronVerified import paths — ran on the pinned version, not inferred.
Render a Mustache template string with provided data. Chevron handles basic variables, sections, and lists according to the Mustache specification.
Upgrade to Python 3.6+ to use Chevron 0.13.0 or newer. For Python 2 compatibility, you would need to pin chevron to <0.13.0, though this is not recommended due to Python 2's end-of-life.
If upgrading from <0.11.0 and using partials, ensure you update your `render` calls to use `partials_path` and verify that your partials are correctly located and resolved by the new loader mechanism. Consult the documentation for the `partials_path` parameter.
Be aware of Mustache's truthiness rules for sections when preparing your data context. If you need a section not to render when a value is `0`, you might need to transform your data (e.g., replace `0` with `None` or an empty string) before passing it to `chevron.render()`.
No dependency data recorded yet.