This short reference article shows how to stream data from a Flask web app to HTMX using server-side events (SSE).
If there is a 50% chance something will go wrong, then 9 times out of 10 it will.