PyHAT-stack / awesome-python-htmx

A curated list of things related to python-based web development using htmx
MIT License
1.08k stars 27 forks source link

PyHAT: Awesome Python htmx Awesome

Are you interested in the intersection of Python and Hypermedia-Driven Applications? Head on over to the discussions tab, introduce yourself, and let's get to work!

What is PyHAT? 🧐

PyHAT is more than just a snake with a hat 🐍🤠. It stands for Python htmx ASGI Tailwind—a web stack that allows you to build powerful web applications using nothing more than... drumroll... Python, htmx, and Tailwind.

Quick, take me to the tools already!

Our Goal

We want to promote hypermedia driven applications. That's it. That's the goal.

Okay, well, more specifically, we want to promote htmx within the Python ecosystem.

Why Should I Care?

Does any of this sound like you:

If the above sounds like you then you are in the right place!

Maybe This Isn't For Me

One of the links above goes to When Should You Use Hypermedia over at htmx.org, and is a pretty great read if you want to asses if this is for you. It also expounds on the following points:

Hypermedia might not be a good fit:

But Will it Work in Production?

Yes! Here is a very good example of a project a company underwent using HTMX with Django in production. You can also watch the original video from DjangoCon EU 2022, titled From React to htmx on a real-world SaaS product: we did it, and it's awesome!

Some highlights from the article. > - The effort took about 2 months (with a 21K LOC code base, mostly JavaScript) > - No reduction in the application’s user experience (UX) > - They reduced the code base size by 67% (21,500 LOC to 7200 LOC) > - They increased python code by 140% (500 LOC to 1200 LOC), a good thing if you prefer python to JS > - They reduced their total JS dependencies by 96% (255 to 9) > - They reduced their web build time by 88% (40 seconds to 5) > - First load time-to-interactive was reduced by 50-60% (from 2 to 6 seconds to 1 to 2 seconds) > - Much larger data sets were possible when using htmx, because react simply couldn’t handle the data > - Web application memory usage was reduced by 46% (75MB to 45MB)

Glossary :scroll:

Usage ✏️

Htmx can be used with any backend framework. Currently, there is a lot of experimentation in the Python space, which is exciting! But that also means that there are a lot of disparate approaches.

The best advice here is to get familiar with some of the core packages (htmx, tailwind). Then feel free to check out any of the packages below.

Official Resources 📚

Introductory Resources 🔰

Introductory Courses 🏫

Design, Theory, and Patterns 🧠

Third Party Packages 📦

Demos

Templates

Helper Libraries

Frameworks

Components

Tools

Projects Using PyHAT (or similar) 🏗️

Further Reading 📖