pybars3
Handlebars.js templating for Python 3 and 2
Decision gist · record as of 2026-08-14
No—install friction is high (source-only distribution), maintenance is dormant (last release 2019-11-05), and Python version support is outdated (classifiers only list up to 3.4). The copyleft license also restricts proprietary modifications. Consider only if you have an existing codebase already using pybars3 or a specific requirement to share Handlebars templates with a legacy system.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires PyMeta3 as a runtime dependency; source distribution requires a build environment.
- High install friction due to source-only distribution (pybars3-0.9.7.tar.gz).
- Maintenance is dormant—last release was 2019-11-05, over 2474 days ago, though the repository remains active with a recent commit on 2024-07-09.
License · maintenance · safety
copyleft license (copyleft) — Licensed under GNU Lesser General Public License version 3 (copyleft). Any derivative work or modification must be distributed under the same license; proprietary use of modifications is restricted.
last release 2019-11-05 (2474 days) · last repo commit 2024-07-09 · 190 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 355,539 downloads/mo, #7,289 on PyPI
Alternatives
Verify before relying
from pybars import Compiler
compiler = Compiler()
source = u"{{#list people}}{{firstName}} {{lastName}}{{/list}}"
template = compiler.compile(source)
def _list(this, options, items):
result = [u'']
for thing in items:
result.extend(options['fn'](thing))
return result
output = template(
{'people': [{'firstName': 'John', 'lastName': 'Doe'}]},
helpers={'list': _list}
)- Whether PyMeta3 is reliably available and maintained for modern Python versions.
- Current compatibility with Python versions beyond 3.4 (classifiers list only up to 3.4).
- Whether all Handlebars 2.0 features are fully implemented or if gaps remain as noted in the description.
What it is and what it does
Pybars3 is a Python implementation of the Handlebars.js templating language, designed to let you write templates once and use them on both server and client. It compiles Handlebars syntax into Python callables that render templates with data and custom helpers. The package supports a substantial subset of Handlebars features including block helpers, partials, dynamic partials, subexpressions, and scope accessors like @index and @root.
The library works by parsing template source into an abstract syntax tree, then generating Python code that renders the template. Helpers are Python functions that accept context and options; partials are pre-compiled template fragments. The package uses a strlist class (a list subclass with a __unicode__ method) to avoid quadratic string concatenation overhead during rendering. It is maintained pragmatically for server-client template sharing rather than as a comprehensive Handlebars port, so not all Handlebars 2.0 features are implemented.
Use it for
- Share template definitions between a Python backend and a JavaScript frontend without rewriting them.
- Render server-side HTML using Handlebars syntax when you prefer it over Jinja2 or other Python templating languages.
- Build custom template helpers in Python that integrate with Handlebars block syntax and context passing.
- Precompile Handlebars templates on the server for distribution to client-side rendering.
- Migrate from a Node.js Handlebars setup to Python while keeping template syntax consistent.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No—install friction is high (source-only distribution), maintenance is dormant (last release 2019-11-05), and Python version support is outdated (classifiers only list up to 3.4).
The copyleft license also restricts proprietary modifications. Consider only if you have an existing codebase already using pybars3 or a specific requirement to share Handlebars templates with a legacy system.
Install
pybars3 on PyPI
Before you install
High install friction due to source-only distribution (pybars3-0.9.7.tar.gz). Maintenance is dormant—last release was 2019-11-05, over 2474 days ago, though the repository remains active with a recent commit on 2024-07-09.
Requires PyMeta3 as a runtime dependency; source distribution requires a build environment.
License in practice
Licensed under GNU Lesser General Public License version 3 (copyleft). Any derivative work or modification must be distributed under the same license; proprietary use of modifications is restricted.
Quickstart
from pybars import Compiler
compiler = Compiler()
source = u"{{#list people}}{{firstName}} {{lastName}}{{/list}}"
template = compiler.compile(source)
def _list(this, options, items):
result = [u'']
for thing in items:
result.extend(options['fn'](thing))
return result
output = template(
{'people': [{'firstName': 'John', 'lastName': 'Doe'}]},
helpers={'list': _list}
)
Verify before relying
- Whether PyMeta3 is reliably available and maintained for modern Python versions.
- Current compatibility with Python versions beyond 3.4 (classifiers list only up to 3.4).
- Whether all Handlebars 2.0 features are fully implemented or if gaps remain as noted in the description.
Package facts
| License | copyleft license copyleft |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Dormant 2,474 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 355,539 / month, #7,289 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)Operating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4 |
Evidence: pybars3-0.9.7.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “handlebars template engine python”
- pybars3Pybars3 compiles and renders Handlebars.js templates in Python,…
- pybars4Pybars4 compiles and renders Handlebars.js templates in Python,…
- pydantic-handlebarsRenders Handlebars templates for composing LLM prompts, with…
Give your agent the search over MCP, or paste the wish link into any chat.
More Markup packages
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
A Python markdown parser that converts markdown to HTML following the CommonMark specification, with support for plugins and custom syntax rules.
Install it if you need reliable markdown-to-HTML conversion.
Beautiful Soup parses HTML and XML documents into a navigable tree, providing Pythonic methods to search, iterate, and modify the parsed content.
Install it if you need to parse or extract data from markup documents.
et_xmlfile writes large XML files with minimal memory overhead by serializing elements to disk as they are created, rather than holding the entire tree in memory.
Install it if incremental XML writing fits your use case; skip it if your XML documents are small or you already use lxml.
Parses and edits TOML files while preserving formatting, comments, and structure, then serializes them back with layout intact.
Install it if you're building tools that touch TOML files and user readability of the source matters.
Parses Python docstrings in ReST, Google, Numpydoc, and Epydoc formats, extracting structured information like descriptions, parameters, return types, and exceptions.
Install it if you need to programmatically read and extract structured data from Python docstrings.
See also pybars4 · stylus · pydantic-handlebars · chevron · jinja_partials · django-template-partials · Mako · djlint · pystache · laces