python-fasthtml
The fastest way to create an HTML app
What it is and what it does
FastHTML is a Python web framework designed to simplify building interactive web applications by using HTML-over-the-wire with HTMX instead of traditional JavaScript frontends. It maps Python functions directly to HTTP routes and HTML elements, letting you write full-stack applications in pure Python. The framework uses starlette and uvicorn under the hood and integrates with beautifulsoup4 for HTML manipulation and httpx2 for HTTP requests.
The core idea is that your Python functions return HTML fragments, and HTMX handles swapping them into the page on the client side—eliminating the need to write JavaScript or manage a separate frontend. It ships with fastcore for functional utilities and includes support for authentication (via oauthlib), file uploads (python-multipart), and date handling (python-dateutil). The framework is still in Alpha, so the API may change, but it has active development and a growing community.
Use it for:
- Build interactive web dashboards and admin panels without writing JavaScript or managing a frontend build process.
- Create real-time collaborative applications where server-side HTML generation and HTMX swaps keep the UI in sync.
- Prototype web applications quickly using Python's full ecosystem while keeping code minimal and readable.
- Add interactivity to existing HTML pages by serving partial HTML fragments in response to user actions.
- Build form-heavy applications where server-side validation and rendering logic can be expressed in pure Python.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
FastHTML is a Python web framework that builds interactive web applications using HTML-over-the-wire with HTMX, allowing you to write full-stack web apps in Python without writing JavaScript.
Yes, if you want to build interactive web apps in pure Python and are comfortable with Alpha-stage software. The low install friction, active maintenance, permissive license, and strong community signal make it a solid choice for prototyping or production use in teams that prefer Python over JavaScript. Not recommended if you need a stable, battle-tested framework or require a large ecosystem of third-party integrations.
Install
python-fasthtml on PyPI
pip
pip install python-fasthtmluv
uv add python-fasthtmlpoetry
poetry add python-fasthtmlInstalling python-fasthtml
Before you install
Low install friction with a pure-Python wheel and nine runtime dependencies. The project is actively maintained with a recent release (14 days ago) and strong community engagement (7006 GitHub stars), though it remains in Alpha status, so expect API changes.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions—suitable for most projects.
Quickstart
pip install python-fasthtml
from fasthtml.common import *
app, rt = fast_app()
@rt('/')
def get():
return Div(P('Hello World!'))
serve()
Requires Python 3.10 or later.
Verify before relying
- Whether the nine runtime dependencies (including uvicorn, starlette, httpx2) are all required for minimal apps or if some are optional.
- Performance characteristics and scalability limits compared to other Python web frameworks.
- Maturity of the HTMX integration and stability of the API given the Alpha status.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — fastcore, python-dateutil, starlette, oauthlib, itsdangerous, uvicorn, httpx2, python-multipart, beautifulsoup4 |
| Maintenance | actively maintained — 14 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,108,486/month — #4,360 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_fasthtml-0.14.11-py3-none-any.whl
Keywords: nbdev, jupyter, notebook, python
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
hyperscriptHyperscript lets you generate HTML markup…
permissive · top 15,000 on PyPI
litestar-htmxIntegrates HTMX into Litestar web applications,…
permissive · top 5,000 on PyPI
django-htmxProvides Django integration utilities for htmx,…
permissive · top 5,000 on PyPI
niceguiNiceGUI is a Python framework for building…
permissive · top 5,000 on PyPI
htpyhtpy lets you write HTML directly in Python…
permissive · top 15,000 on PyPI
html5taggerGenerates HTML5 markup programmatically using…
permissive · top 5,000 on PyPI
fastuiFastUI lets you build responsive web…
permissive · top 15,000 on PyPI
brancaBranca generates HTML and JavaScript pages from…
permissive · top 5,000 on PyPI
sphinxcontrib-jsmathA Sphinx extension that renders mathematical…
permissive · top 1,000 on PyPI
streamlitStreamlit transforms Python scripts into…
permissive · top 1,000 on PyPI