Lightweight HAML-ish template compiler with support for Django and Jinja2 templates

converter, django, flask, haml, haml-ish, html, jinja2, parser, python, template
pip install hamplify==1.3.0


Build Status Coverage Status PyPI version


hamplify is a lightweight HAML-ish compiler written in Python.

Here are some reasons to use hamplify:

  • Compatible with Python 2.7 and 3.3+
  • Requires NO dependencies and is framework agnostic
  • Support for Django and Jinja2 templates
  • Templates are automatically minified
  • Integrates seamlessly into existing projects

Using hamplify

Install hamplify with pip:

pip install hamplify

Use the hamplify command to compile your templates:

hamplify <input-dir> <output-dir> [--watch]

Running Tests

Install the test dependencies

pip install -r reqs/test.txt

Run the tests

pytest --cov=hamplify

Syntax Sample

      - block title
        My Site

    %link(rel="stylesheet" href="style.css")

      p {
        background-color: #CCC;

    -# This is an HTML comment
    / This is another comment, 
      but it won't be rendered

      %p A paragraph with some text.
      %button.btn#my-button A button

      %a(href='#')= the_link|some_filter

        This is a plaintext block. The compiler will not parse anything in here.

      console.log("Hello, world!");