PyHTML Enhanced

PyHTML Enhanced is a library for generating HTML documents. It is inspired by (and similar to) Cenk Altı's PyHTML library, but with improved documentation and type safety.

The library has been used by over 100 students in UNSW's COMP1010 course, allowing them to create advanced and dynamic websites, with full IDE support and type safety for all HTML tags. The advanced editor support means that the library is accessible and intuitive, even for students with no prior programming experience.

>>> import pyhtml as p
>>> my_website = p.html(
...     p.head(
...         p.title("Hello, world!"),
...         p.script(src=""),
...     ),
...     p.body(
...         p.h1("Hello, world!"),
...         p.p("This is my amazing website!"),
...     ),
... )
>>> print(str(my_website))
<!DOCTYPE html>
      Hello, world!
    <script type="text/javascript" src=""></script>
      Hello, world!
      This is my amazing website!

Project status: