Dominate
Dominate is a Python library for creating and manipulating HTML docs
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 eliminates the need to learn another template language, and lets you take advantage of the more powerful features of Python. Dominate can also use keyword arguments to append attributes onto your tags.