Skip to Content Skip to Navigation

A few weeks ago I open sourced a tiny library I’ve been noodling on for a while:

It’s for generating HTML from basic Python data structures. It’s a bit weird and most people will probably hate it (which is fine). But I’ve now built a moderately complicated web app with it and I’m never going back to string-based templates!

Oh, and it runs quite happily under MicroPython on a ~£4 microcontroller, which is fun.

Edited 48d ago

@jamie 🎉 Congrats. hotmetal is shiny. I'm a fan of these libraries because they are nice for the occasional itch.

It kind of reminds me of which is worth pointing out on the off chance there's something useful there since it's archived.

@webology huh, I’d found a few libraries like that but didn’t realise @adamchainz made one!

One nice thing about manipulating tuples directly (rather than wrapping tags in functions and using kwargs for attrs) is that you don’t have to worry about that kinda janky class_ thing 😆 just do {“class”: “whatever”}

@jamie @webology Yeah mine was just an experiment.

Nice idea to use plain data structures, should keep it fast.

Type hints could help make this a bit more ergonomic.