DEV Community

domonic
domonic

Posted on

python DOM. pip install domonic. 0.9.10 python. create html with python DOM for html generation. python3 python html

Have you tried domonic?

A dom made for python.

pip install domonic

python3

from domonic.html import *
mydom = html(body(h1('Hello, World!'), a("somelink", _href="somepage.html")))

print(f"{mydom}")

<!DOCTYPE html>
<html>
    <body>
        <h1>Hello, World!</h1>
        <a href="somepage.html">somelink</a>
    </body>
</html>
Enter fullscreen mode Exit fullscreen mode

https://github.com/byteface/domonic/

Top comments (0)