pybars4
Handlebars.js templating for Python 3
Decision gist · record as of 2026-08-14
No. The package is abandoned (last update 2021-04-04) with no active maintenance, high install friction, and a copyleft license that restricts use in proprietary code. Unless you are maintaining legacy code already using pybars4, consider modern alternatives.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installation friction is high; the package has no runtime dependencies but the distribution is source-only.
- Maintenance is abandoned—the last commit was 2021-04-04 with minimal repository activity (2 stars).
- No active support or updates should be expected.
License · maintenance · safety
copyleft license (copyleft) — Pybars4 is licensed under the GNU Lesser General Public License version 3 (copyleft). Any derivative work or modification must be released under the same license; linking from proprietary code is permitted but redistribution of modifications requires license compliance.
last release 2021-04-04 (1958 days) · last repo commit 2021-04-04 · 2 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 309,208 downloads/mo, #7,759 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 dependency is correctly declared in package metadata (documented as required but not listed in runtime deps)
- Current compatibility with Python versions beyond 3.4 (classifiers list only up to 3.4; modern Python support unknown)
- Completeness of Handlebars 2.0 feature coverage and any known gaps beyond those acknowledged in the description
What it is and what it does
Pybars4 is a Python implementation of the Handlebars.js templating language, designed to let you write templates once and use them in both server-side Python code and client-side JavaScript. It compiles Handlebars syntax into Python callables that render output by combining template logic with data and helper functions. The package supports many Handlebars features including partials, custom helpers, block statements, scope accessors like `@index` and `@root`, and dynamic partials, though not all Handlebars 2.0 features are fully implemented.
The package is maintained as a pragmatic fork of pybars3 to enable Python 3 compatibility and add features from Handlebars.js 2.0. It uses a custom `strlist` class to avoid quadratic string concatenation overhead during rendering. Helpers are Python functions that receive context, options, and arguments, and can return lists, tuples, or strlist instances to control escaping behavior.
Use it for
- Render server-side templates using the same Handlebars syntax your frontend already uses, reducing template duplication.
- Build custom helpers in Python to extend template logic beyond what Handlebars provides natively.
- Generate HTML or text output from templates with partials, loops, and conditional blocks.
- Share template files between a Python backend and JavaScript frontend without rewriting syntax.
- Precompile templates for efficiency in high-volume rendering scenarios.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No.
The package is abandoned (last update 2021-04-04) with no active maintenance, high install friction, and a copyleft license that restricts use in proprietary code. Unless you are maintaining legacy code already using pybars4, consider modern alternatives.
Install
pybars4 on PyPI
Before you install
Installation friction is high; the package has no runtime dependencies but the distribution is source-only. Maintenance is abandoned—the last commit was 2021-04-04 with minimal repository activity (2 stars). No active support or updates should be expected.
License in practice
Pybars4 is licensed under the GNU Lesser General Public License version 3 (copyleft). Any derivative work or modification must be released under the same license; linking from proprietary code is permitted but redistribution of modifications requires license compliance.
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 dependency is correctly declared in package metadata (documented as required but not listed in runtime deps)
- Current compatibility with Python versions beyond 3.4 (classifiers list only up to 3.4; modern Python support unknown)
- Completeness of Handlebars 2.0 feature coverage and any known gaps beyond those acknowledged in the description
Package facts
| License | copyleft license copyleft |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Abandoned 1,958 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 309,208 / month, #7,759 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: pybars4-0.9.13.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.js python compatibility”
- pybars4Pybars4 compiles and renders Handlebars.js templates in Python,…
- pybars3Pybars3 compiles and renders Handlebars.js templates in Python,…
- mo-futureProvides a flat-namespace compatibility layer for Python 2/3 code…
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 pybars3 · pydantic-handlebars · stylus · chevron · djlint · django-template-partials · Mako · jinja_partials · pystache · laces