{"id":1415,"library":"chevron","title":"Chevron Mustache Templating","description":"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.","status":"active","version":"0.14.0","language":"python","source_language":"en","source_url":"https://github.com/noahmorrison/chevron","tags":["templating","mustache","html","text-generation"],"install":[{"cmd":"pip install chevron","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"wrong":"import chevron","symbol":"render","correct":"from chevron import render"}],"quickstart":{"code":"import chevron\n\ntemplate_string = 'Hello, {{name}}! You are {{age}} years old.'\ndata_context = {'name': 'World', 'age': 42}\n\nrendered_output = chevron.render(template=template_string, data=data_context)\nprint(rendered_output)\n\n# Example with a list and conditional section\ntemplate_list = 'Users:\\n{{#users}}- {{name}} (ID: {{id}})\\n{{/users}}'\ndata_list = {'users': [{'name': 'Alice', 'id': 1}, {'name': 'Bob', 'id': 2}] }\nrendered_list = chevron.render(template=template_list, data=data_list)\nprint(rendered_list)","lang":"python","description":"Render a Mustache template string with provided data. Chevron handles basic variables, sections, and lists according to the Mustache specification."},"warnings":[{"fix":"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.","message":"Python 2 support was dropped in Chevron version 0.13.0. Attempts to use chevron on Python 2.x environments will result in errors.","severity":"breaking","affected_versions":">=0.13.0"},{"fix":"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.","message":"The mechanism for resolving partials changed significantly in version 0.11.0. The `path` parameter for specifying partial locations was renamed to `partials_path` and partials are now resolved via a template loader.","severity":"breaking","affected_versions":">=0.11.0"},{"fix":"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()`.","message":"Mustache's definition of 'falsy' for sections (e.g., `{{#section}}`) differs from Python's default behavior. In Mustache, `0` (the number zero) is considered 'truthy' for sections, while an empty list `[]` is 'falsy'. This can be counter-intuitive for Python developers used to `bool(0)` being `False`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'0.14.0':43 'adher':33 'api':21 'as-need':49 'bug':55 'cadenc':53 'chevron':1,4 'close':34 'context':31 'current':40 'data':30 'dictionari':26 'fix':56 'follow':47 'general':46 'generat':70 'html':67 'implement':11 'improv':59 'languag':16 'lightweight':7 'long':61 'minor':58 'mustach':2,14,37,66 'need':51 'object':28 'period':62 'provid':18 'pure':9 'pure-python':8 'python':10 'releas':52 'render':23 'simpl':20 'specif':38 'stabil':64 'templat':3,15,24,65 'text':69 'text-gener':68 'use':25 'version':41","created_at":"2026-04-09T03:46:57.182425+00:00","updated_at":"2026-04-16T02:01:26.785387+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":80,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.14.0","cli_name":"chevron","cli_version":"0.14.0","type":"library","homepage":null,"github":"https://github.com/noahmorrison/chevron","docs":null,"changelog":null,"pypi":"https://pypi.org/project/chevron/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-08-27","next_check":"2026-07-30","install_tag":"verified"}}