Knio/dominate
View on GitHub ↗ ★ 1,831 Python
Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API. It allows you to write HTML pages in pure Python very concisely, which eliminate the need to learn another template language, and to take advantage of the more powerful features of Python.
6 mentions on Hacker News by 6 people: 1 story, 5 comments · first 2018-10-12 · latest 2025-09-03
20082026
-
…write code as code. I ended up spending a week implementing something similar to Dominate in Rust. https://github.com/Knio/dominate
comment by Rendello · 2025-09-03 · in Sharing a mutable reference between Rust and Python -
▲ 1
Dominate: A Python/JavaScript lib for generating HTML documentsstory by prabhu-yu · 2024-12-14 · 1 comment
-
…a matter of getting used to it - and after a while it end ups feeling very natural to use :-) 1: https://github.com/Knio/dominate#readme
comment by rougemine · 2024-03-21 · in Ludic: New framework for Python with seamless Htmx support -
Pretty much how https://github.com/Knio/dominate does it, but no context variable binding (otherwise gets messy with lots of nesting)
comment by pphysch · 2023-05-27 · in The obvious final step -
…document as the tree of nodes that it is in your programming language or treat it like a string. https://github.com/Knio/dominate is a Python lib that implements this principal.
comment by Spivak · 2023-05-26 · in That people produce HTML with string templates is telling us something -
I feel you, however I also love https://github.com/Knio/dominate - a Python library to generate HTML. Generating HTML always felt awkward for me in many languages. From PHP where you sprinkle PHP between HTML or HTML between PHP, to…
comment by jacobush · 2018-10-12 · in Asterisks in Python