Skip to content


  • pyxy - Write HTML tags directly in Python (like JSX). Uses htpy to generate markup. A modern take on pyxl.

Projects That Use htpy

Prior implementations of HTML in Python

htpy was heavily inspired by many other libraries that came before it.

  • JSX/React - Made writing HTML in a programming language popular.
  • pyxl, pyxl3, pyxl4 - Write HTML in Python with JSX-like syntax. Not actively maintained.
  • htbuilder - Very similar to htpy but does not currently support automatic escaping.
  • nevow.stan - Probably the earliest use of [] syntax for specifying children. Not actively maintained.
  • breve - Another early implementation of HTML in Python, Using getattr [] syntax for children. Not actively maintained.
  • hyperscript - JavaScript library that also uses CSS selector-like syntax for specifying id and classes.
  • hyperpython - A Python interpretation of hyperscript. Not actively maintained.
  • h by Adam Johnson - Similar to htpy, uses call syntax (()) for attributes and getitem ([]) for children.
  • lxml.builder - lxml's E allows creating XML/XHTML documents from Python.

Articles About HTML Generation Without Templates