I started learning FastHTML but somebody on reddit mentioned htpy. In my opinion htpy+fastapi is awesome combo. I like the way htpy handles declaring html components.
It's also a bit of an odd thing to be in python, then just because you need to loop you need to write Jinja or other templates which are different languages basically. Might be nicer to write a loop in python.
It's a bit different for requests though. FastAPI will allow you to define your request schema (application/json or application/x-www-form-urlencoded) and validate it using pydantic, but starlette doesn't do that OOtB. It's trivial to implement though, and if it were me I would probably choose to do that rather than deal with FastAPI's inflexibility.
https://github.com/pyxl4/pyxl4?tab=readme-ov-file#inline-pyt...
It's a shitty experience.