Skip to content

Instantly share code, notes, and snippets.

View Kvit's full-sized avatar

Vitali Khvatkov Kvit

View GitHub Profile
@Kvit
Kvit / main.py
Last active March 20, 2025 15:45 — forked from axelknock/main.py
Example of Datastar with FastHTML, ported from a FastAPI example
import asyncio
import json
from datetime import datetime
from fasthtml.common import *
from fasthtml.starlette import StreamingResponse
from fasthtml.core import to_xml
from datastar_py.sse import SSE_HEADERS, ServerSentEventGenerator